前言:
#include <typeindex>
typeindex库 包含两个类 std::type_info 和 std::type_index
type_info
type_info 可以用来接收 typeid 的返回值,常用成员函数如下:
(C++11) | returns a value which is identical for the same types (public member function) |
implementation defined name of the type (public member function) |
type_index
type_index 是对 type_info 的包装,其中包含 type_info 成员变量
returns hashed code (public member function) | |
returns implementation defined name of the type, associated with underlying type_info object (public member function) |