Namespaces
Variants

std::type_info::before

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 before( const type_info& rhs ) const;
(C++11부터 noexcept)

true를 반환합니다. type_info의 타입이 구현체의 정렬 순서에서 rhs의 타입보다 앞서는 경우. 어떠한 보장도 제공되지 않습니다. 특히, 정렬 순서는 동일한 프로그램의 호출 사이에 변경될 수 있습니다.

매개변수

rhs - 비교할 다른 타입 정보 객체

반환값

true 를 반환합니다, 만약 이 type_info 의 타입이 구현체의 정렬 순서에서 rhs 의 타입보다 앞선 경우.

예제

#include <iostream>
#include <typeinfo>
int main()
{
    if (typeid(int).before(typeid(char)))
        std::cout << "int goes before char in this implementation.\n";
    else
        std::cout << "char goes before int in this implementation.\n";
}

가능한 출력:

char goes before int in this implementation.

참고 항목

(removed in C++20)
객체가 동일한 타입을 참조하는지 확인합니다
(public member function)