std::type_index (3) - Linux Manuals
std::type_index: std::type_index
NAME
std::type_index - std::type_index
Synopsis
Defined in header <typeindex>
class type_index; (since C++11)
The type_index class is a wrapper class around a std::type_info object, that can be used as index in associative and unordered associative containers. The relationship with type_info object is maintained through a pointer, therefore type_index is CopyConstructible and CopyAssignable.
Member functions
constructor (public member function)
destructor destroys the type_index object
(implicitly declared)
operator= assigns a type_index object
(implicitly declared)
operator==
operator!= compares the underlying std::type_info objects
operator< (public member function)
operator<=
operator>
operator>=
hash_code (public member function)
name associated with underlying type_info object
Helper classes
std::hash<std::type_index> hash support for std::type_index
(C++11)
Example
The following program is an example of an efficient type-value mapping.
// Run this code