one of the most highly regarded and expertly designed C++ library projects in the world.
— Herb Sutter and Andrei Alexandrescu, C++ Coding Standards
Copyright © 2012-2025 Antony Polukhin
根据 Boost 软件许可证版本 1.0 发布。(参见随附文件 LICENSE_1_0.txt 或在 https://boost.ac.cn/LICENSE_1_0.txt 复制)
目录
有时需要在运行时获取和存储类型信息。在这种情况下,通常会使用诸如 &typeid(T)
或 C++11 类 std::type_index
这样的结构,但问题也由此开始。
typeid(T)
和 std::type_index
需要运行时类型信息 (RTTI)。typeid(T)
的实现错误地没有剥离类型中的 const、volatile 和引用。std::type_info
对象。std::type_index
。Boost.TypeIndex 库旨在解决所有这些问题。
![]() |
注意 |
---|---|
|