map.hpp
A drop-in wrapper for std::map and std:multimap; makes sure we create vars on access.
This class is a drop-in wrapper for std::map, adding on debbing where the indexing operator [square brackets] returns a proxy. That proxy can either be assigned to OR convert an existing value ONLY if it exists. This mechanism ensures that we don’t accidentally write a default value to a map when all we meant to do was read from it, but had a typo. If EMP_NDEBUG is set then it reverts back to std::map.
Note
Status: ALPHA
-
template<class Key, class T, class ...Ts>
class map : public std::map<Key, T, Ts...> - #include <map.hpp>
Public Types
-
using value_type = std::pair<const key_type, mapped_type>
Public Functions
-
inline explicit map(const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type())
-
inline explicit map(const allocator_type &alloc)
-
template<class InputIterator>
inline map(InputIterator first, InputIterator last, const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type())
-
inline map(const this_t &x, const allocator_type &alloc)
-
inline map(this_t &&x, const allocator_type &alloc)
-
inline map(std::initializer_list<value_type> il, const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type())
-
using value_type = std::pair<const key_type, mapped_type>
-
template<class Key, class T, class ...Ts>
class multimap : public std::multimap<Key, T, Ts...> - #include <map.hpp>
Public Types
-
using value_type = std::pair<const key_type, mapped_type>
Public Functions
-
inline explicit multimap(const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type())
-
inline explicit multimap(const allocator_type &alloc)
-
template<class InputIterator>
inline multimap(InputIterator first, InputIterator last, const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type())
-
inline multimap(const this_t &x, const allocator_type &alloc)
-
inline multimap(this_t &&x, const allocator_type &alloc)
-
inline multimap(std::initializer_list<value_type> il, const key_compare &comp = key_compare(), const allocator_type &alloc = allocator_type())
-
using value_type = std::pair<const key_type, mapped_type>