std:: type_info
From cppreference.net
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::type_info
| Member functions | ||||
|
(until C++20)
|
||||
|
(C++11)
|
||||
|
헤더에 정의됨
<typeinfo>
|
||
|
class
type_info
;
|
||
type_info
클래스는 타입의 이름, 두 타입의 동등성 비교 및 정렬 순서 비교 방법을 포함하여 타입에 대한 구현별 정보를 보유합니다. 이 클래스는
typeid
연산자가 반환하는 클래스입니다.
type_info
클래스는
CopyConstructible
도
CopyAssignable
도 아닙니다.
멤버 함수
|
(constructor)
[deleted]
|
기본 생성자와 복사 생성자를 모두 가지지 않음
(public member function) |
|
[virtual]
|
가상 소멸자로 인해
type_info
가 다형성 클래스가 됨
(virtual public member function) |
|
operator=
[deleted]
|
복사 할당할 수 없음
(public member function) |
|
(removed in C++20)
|
객체들이 동일한 타입을 참조하는지 확인
(public member function) |
참조된 타입이 다른
type_info
객체의 참조된 타입보다 구현 정의 순서에서 앞서는지 확인, 즉 참조된 타입들을 정렬함 (public member function) |
|
|
(C++11)
|
동일한 타입에 대해 일치하는 값을 반환
(public member function) |
|
구현 정의된 타입 이름
(public member function) |
참고 항목
|
(C++11)
|
type_info
객체를 감싸는 래퍼로, 연관 컨테이너와 비순차 연관 컨테이너에서 인덱스로 사용 가능
(클래스) |
typeid
|
타입 정보를 질의하며, 해당 타입을 나타내는
std::type_info
객체 반환
(내장 연산자) |