...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: August 04, 2022 at 02:55:28 GMT |