std::type_index::operator==,!=,<,<=,>,>=,<=>
From cppreference.com
< cpp | types | type index
| 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` オブジェクト |
[編集] 戻り値
3-6) 対応する順序で型が並べ替えられている場合は true、そうでない場合は false。
7) 基になる std::type_info オブジェクトが同じ型を参照している場合は std::strong_ordering::equal。そうでない場合、*this の基になる std::type_info オブジェクトが実装定義の順序で `rhs` の前に来る場合は std::strong_ordering::less、それ以外の場合は std::strong_ordering::greater。