|
tinympl
0.2
mini MPL library for C++11
|
A compile time map from a type to another This class represents a compile time mapping between types. The mapping is specified using std::pair, that is every parameter of map must be an std::pair<KeyType,ValueType>.
More...
#include <tinympl/map.hpp>
Classes | |
| class | at |
| Return the value element with the given key. More... | |
| class | erase |
Return a new map constructed by the current map removing the Key key, if present, otherwise return the current map. More... | |
| class | insert |
| Returns a new map with the new Key/Value pair, or this map if the key is already present in the map. More... | |
| class | insert_many |
| Calls insert many times to insert many Key/Value pairs. More... | |
Public Types | |
| enum | { size = sizeof ... (Args) } |
| enum | { empty = (size == 0) } |
| template<class Key > | |
| using | count = std::integral_constant< std::size_t,(variadic::find< Key, typename Args::first_type... >::type::value==size?0:1)> |
| Count the number of elements in the map with a given key. More... | |
A compile time map from a type to another This class represents a compile time mapping between types. The mapping is specified using std::pair, that is every parameter of map must be an std::pair<KeyType,ValueType>.
map supports standard insertion/removal and element access.
map, in order to make the order in which the key/value pairs are specified irrelevant. | using tinympl::map< Args >::count = std::integral_constant< std::size_t, (variadic::find<Key, typename Args::first_type ... >::type::value == size ? 0 : 1)> |
Count the number of elements in the map with a given key.
map and not a multimap, the only possible results for this operation are 0 and 1.