...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Copyright © 2011-2013 Steven Watanabe
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Table of Contents
The Boost.TypeErasure library provides runtime polymorphism in C++ that is more flexible than that provided by the core language.
C++ has two distinct kinds of polymorphism, virtual functions and templates, each of which has its own advantages and disadvantages.
The Boost.TypeErasure library combines the superior abstraction capabilities of templates, with the runtime flexibility of virtual functions.
Boost includes several special cases of this kind of polymorphism:
boost::any
for CopyConstructible types.
boost::function
for objects that can be called
like functions.
any_iterator
.
Boost.TypeErasure generalizes this to support arbitrary requirements and provides a predefined set of common concepts
Last revised: June 25, 2013 at 22:28:05 GMT |