Namespaces
Variants

std::type_info:: before

From cppreference.net
Utilities library
bool before ( const type_info & rhs ) const ;
(C++11부터 noexcept)

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

목차

매개변수

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)