This is a simple struct that features the use of std::type_info
as key values of container types like hash tables and sets. For this, this struct provides inner functors hash, equal_to and less.
If for example a std::unordered_map
should be instantiated with run-time type information as the hash key, a definition looks as follows:
std::unordered_map<TypeFunctors::Key, MyMappedType, TypeFunctors::Hash, TypeFunctors::EqualTo > myMap;
Note that the key type evaluates to const std::type_info*
, hence pointers to the structs have to be given when interfacing with the container.
Definition at line 64 of file std_typeinfo.hpp.
#include <std_typeinfo.hpp>
Inner Type Index: | |
struct | EqualTo |
struct | Hash |
struct | Less |
Public Type Index: | |
using | Key = const ::std::type_info* |
using Key = const ::std::type_info* |
The key type
Definition at line 67 of file std_typeinfo.hpp.