Boost C++ 库
... 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
根据 Boost 软件许可证版本 1.0 发布。(参见随附文件 LICENSE_1_0.txt 或在 https://boost.ac.cn/LICENSE_1_0.txt 复制)
目录
Boost.TypeErasure 库提供了比 C++ 核心语言更灵活的运行时多态。
C++ 有两种截然不同的多态形式:虚函数和模板,它们各有优缺点。
Boost.TypeErasure 库结合了模板卓越的抽象能力和虚函数运行时灵活性。
Boost 包含了几种这种多态的特例
boost::any 用于 CopyConstructible 类型。boost::function 用于可以像函数一样调用的对象。any_iterator。Boost.TypeErasure 将此泛化以支持任意需求,并提供了一套预定义的常见概念