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.