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 49 of file std_typeinfo.hpp.
#include <std_typeinfo.hpp>
Inner Type Index: | |
| struct | EqualTo |
Comparison functor for type const std::type_info*. More... | |
| struct | Hash |
Hash code functor for type const std::type_info*. More... | |
| struct | Less |
Comparison functor for type const std::type_info*. More... | |
Public Type Index: | |
| using | Key = const ::std::type_info* |
| The key type. | |
| using Key = const ::std::type_info* |
The key type.
Definition at line 52 of file std_typeinfo.hpp.