Namespaces
Variants
Views
Actions

std::type_info

From cppreference.com
< cpp‎ | types
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
 
 
Defined in header <typeinfo>
class type_info;

The class type_info holds implementation-specific information about a type, including the name of the type and means to compare two types for equality or collating order. This is the class returned by the typeid operator.

The type_info class is neither CopyConstructible nor CopyAssignable.

[edit] Member functions

(constructor)
[deleted]
has neither default nor copy constructors
(public member function)
[virtual]
the virtual destructor makes type_info a polymorphic class
(virtual public member function)
operator=
[deleted]
can not be copy-assigned
(public member function)
(removed in C++20)
checks whether the objects refer to the same type
(public member function) [edit]
checks whether the referred type precedes referred type of another type_info
object in the implementation defined order, i.e. orders the referred types
(public member function) [edit]
(C++11)
returns a value which is identical for the same types
(public member function) [edit]
implementation defined name of the type
(public member function) [edit]

[edit] See also

wrapper around a type_info object, that can be used as index in associative and unordered associative containers
(class) [edit]
typeid Queries information of a type, returning a std::type_info object representing the type
(built-in operator)