std:: type_info
From cppreference.net
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::type_info
| Member functions | ||||
|
(until C++20)
|
||||
|
(C++11)
|
||||
|
ヘッダーで定義
<typeinfo>
|
||
|
class
type_info
;
|
||
type_info
クラスは、型の名前や二つの型の等値比較・照合順序のための手段を含む、実装固有の型情報を保持します。これは
typeid
演算子によって返されるクラスです。
type_info
クラスは
CopyConstructible
でも
CopyAssignable
でもありません。
メンバー関数
|
(constructor)
[deleted]
|
デフォルトコンストラクタもコピーコンストラクタも持たない
(public member function) |
|
[virtual]
|
仮想デストラクタにより
type_info
は多態クラスとなる
(virtual public member function) |
|
operator=
[deleted]
|
コピー代入できない
(public member function) |
|
(removed in C++20)
|
オブジェクトが同じ型を参照しているかどうかをチェックする
(public member function) |
参照している型が別の
type_info
オブジェクトの参照型より実装定義の順序で先行するかどうかをチェックする (public member function) |
|
|
(C++11)
|
同じ型に対して同一の値を返す
(public member function) |
|
実装定義の型名
(public member function) |
関連項目
|
(C++11)
|
type_info
オブジェクトのラッパーで、連想コンテナおよび非順序連想コンテナのインデックスとして使用可能
(クラス) |
typeid
|
型の情報を問い合わせ、その型を表す
std::type_info
オブジェクトを返す
(組み込み演算子) |