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 .