C++库 - <typeinfo>



简介

它包含类型信息并存储关于类型的相关信息。它可以用来比较两种类型或检索识别类型的相关信息。

声明

以下是std::type_info的声明。

class type_info;

C++11

class type_info;

成员函数

序号 成员函数及描述
1 operator==

它包含类型信息。

2 operator!=

动态转换失败时抛出异常。

3 before

对空指针进行typeid操作时抛出异常。

4 name

动态转换失败时抛出异常。

5 hash_code

对空指针进行typeid操作时抛出异常。

typeinfo.htm
广告
© . All rights reserved.