std::type_index::operator==,!=,<,<=,>,>=,<=>
ja.cppreference.net より
bool operator==( const type_index& rhs ) const noexcept;
|
(1) | (C++11以上) |
bool operator!=( const type_index& rhs ) const noexcept;
|
(2) | (C++11以上) (C++20未満) |
bool operator<( const type_index& rhs ) const noexcept;
|
(3) | (C++11以上) |
bool operator<=( const type_index& rhs ) const noexcept;
|
(4) | (C++11以上) |
bool operator>( const type_index& rhs ) const noexcept;
|
(5) | (C++11以上) |
bool operator>=( const type_index& rhs ) const noexcept;
|
(6) | (C++11以上) |
std::strong_ordering operator<=>( const type_index& rhs ) const noexcept;
|
(7) | (C++20以上) |
基となる std::type_info オブジェクトを比較します。
1,2) 基となる std::type_info オブジェクトが同じ型を参照しているか確認します。
|
上記の |
(C++20以上) |
パラメータ
| rhs | - |
比較対象の別の
type_index
オブジェクト
|
戻り値
7)
std
::
strong_ordering
::
equal
基底の
std::type_info
オブジェクトが同じ型を参照する場合、そうでない場合は
std
::
strong_ordering
::
less
、
*
this
の基底
std::type_info
オブジェクトが実装定義の順序で
rhs
のオブジェクトより先行する場合、そうでない場合は
std
::
strong_ordering
::
greater
。