Namespaces
Variants

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

cppreference.net에서 가져옴
 
 
유틸리티 라이브러리
일반 유틸리티
관계 연산자 (C++20에서 폐지됨)
정수 비교 함수
(C++20)(C++20)(C++20)    
(C++20)
스왑 및 타입 연산
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
공통 어휘 타입
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)



 
 
 
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를 사용해 수행됩니다.

!= 연산자는 synthesized from 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 .