Namespaces
Variants

std::type_index:: operator==,!=,<,<=,>,>=,<=>

From cppreference.net
Utilities library
std::type_index
Member functions
type_index::operator= type_index::operator!= type_index::operator< type_index::operator<= type_index::operator> type_index::operator>= type_index::operator<=>
(until C++20) (C++20)
Helper classes
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 オブジェクトが同じ型を参照しているかどうかをチェックします。
3-7) 実装定義の順序付けによって定義される、基盤となる std::type_info オブジェクトを比較します。比較は type_info::before によって行われます。

!= 演算子は operator== から合成されます

(C++20以降)

パラメータ

rhs - 比較対象の別の type_index オブジェクト

戻り値

1) true 基礎となる std::type_info オブジェクトが同じ型を参照している場合、 false それ以外の場合。
2) true 基礎となる std::type_info オブジェクトが同じ型を参照していない場合、 false それ以外の場合。
3-6) true 基礎となる std::type_info オブジェクトが参照する型が対応する順序で並んでいる場合は false それ以外の場合。
7) std :: strong_ordering :: equal 基底の std::type_info オブジェクトが同じ型を参照する場合、そうでない場合は std :: strong_ordering :: less * this の基底 std::type_info オブジェクトが実装定義の順序で rhs のオブジェクトより先行する場合、そうでない場合は std :: strong_ordering :: greater