unordered_map.hpp

A drop-in wrapper for std::unordered_map and unordered_multi_map; makes sure we create vars on access.

Note

Status: ALPHA

template<class Key, class T, class ...Ts>
class unordered_map : public std::unordered_map<Key, T, Ts...>
#include <unordered_map.hpp>

Public Types

using key_type = Key
using mapped_type = T
using value_type = std::pair<const key_type, mapped_type>
using hasher = typename base_t::hasher
using key_equal = typename base_t::key_equal
using allocator_type = typename base_t::allocator_type
using reference = typename base_t::reference
using const_reference = typename base_t::const_reference
using pointer = typename base_t::pointer
using const_pointer = typename base_t::const_pointer
using iterator = typename base_t::iterator
using const_iterator = typename base_t::const_iterator
using local_iterator = typename base_t::local_iterator
using const_local_iterator = typename base_t::const_local_iterator
using difference_type = typename base_t::difference_type
using size_type = typename base_t::size_type

Public Functions

unordered_map() = default
inline explicit unordered_map(size_type n, const hasher &hf = hasher(), const key_equal &eql = key_equal(), const allocator_type &alloc = allocator_type())
inline explicit unordered_map(const allocator_type &alloc)
inline unordered_map(size_type n, const allocator_type &alloc)
inline unordered_map(size_type n, const hasher &hf, const allocator_type &alloc)
template<class InputIterator>
inline unordered_map(InputIterator first, InputIterator last)
template<class InputIterator>
inline unordered_map(InputIterator first, InputIterator last, size_type n, const hasher &hf = hasher(), const key_equal &eql = key_equal(), const allocator_type &alloc = allocator_type())
template<class InputIterator>
inline unordered_map(InputIterator first, InputIterator last, size_type n, const allocator_type &alloc)
template<class InputIterator>
inline unordered_map(InputIterator first, InputIterator last, size_type n, const hasher &hf, const allocator_type &alloc)
inline unordered_map(const unordered_map &ump)
inline unordered_map(const unordered_map &ump, const allocator_type &alloc)
inline unordered_map(unordered_map &&ump)
inline unordered_map(unordered_map &&ump, const allocator_type &alloc)
inline unordered_map(std::initializer_list<value_type> il)
inline unordered_map(std::initializer_list<value_type> il, size_type n, const hasher &hf = hasher(), const key_equal &eql = key_equal(), const allocator_type &alloc = allocator_type())
inline unordered_map(std::initializer_list<value_type> il, size_type n, const allocator_type &alloc)
inline unordered_map(std::initializer_list<value_type> il, size_type n, const hasher &hf, const allocator_type &alloc)
this_t &operator=(const this_t&) = default
this_t &operator=(this_t&&) = default
inline proxy_t operator[](const Key &k)

Private Types

using this_t = unordered_map<Key, T, Ts...>
using base_t = std::unordered_map<Key, T, Ts...>
using proxy_t = MapProxy<std::decay_t<T>>
template<class Key, class T, class ...Ts>
class unordered_multimap : public std::unordered_multimap<Key, T, Ts...>
#include <unordered_map.hpp>

Public Types

using key_type = Key
using mapped_type = T
using value_type = std::pair<const key_type, mapped_type>
using hasher = typename base_t::hasher
using key_equal = typename base_t::key_equal
using allocator_type = typename base_t::allocator_type
using reference = typename base_t::reference
using const_reference = typename base_t::const_reference
using pointer = typename base_t::pointer
using const_pointer = typename base_t::const_pointer
using iterator = typename base_t::iterator
using const_iterator = typename base_t::const_iterator
using local_iterator = typename base_t::local_iterator
using const_local_iterator = typename base_t::const_local_iterator
using difference_type = typename base_t::difference_type
using size_type = typename base_t::size_type

Public Functions

unordered_multimap() = default
inline explicit unordered_multimap(size_type n, const hasher &hf = hasher(), const key_equal &eql = key_equal(), const allocator_type &alloc = allocator_type())
inline explicit unordered_multimap(const allocator_type &alloc)
inline unordered_multimap(size_type n, const allocator_type &alloc)
inline unordered_multimap(size_type n, const hasher &hf, const allocator_type &alloc)
template<class InputIterator>
inline unordered_multimap(InputIterator first, InputIterator last)
template<class InputIterator>
inline unordered_multimap(InputIterator first, InputIterator last, size_type n, const hasher &hf = hasher(), const key_equal &eql = key_equal(), const allocator_type &alloc = allocator_type())
template<class InputIterator>
inline unordered_multimap(InputIterator first, InputIterator last, size_type n, const allocator_type &alloc)
template<class InputIterator>
inline unordered_multimap(InputIterator first, InputIterator last, size_type n, const hasher &hf, const allocator_type &alloc)
inline unordered_multimap(const unordered_multimap &ump)
inline unordered_multimap(const unordered_multimap &ump, const allocator_type &alloc)
inline unordered_multimap(unordered_multimap &&ump)
inline unordered_multimap(unordered_multimap &&ump, const allocator_type &alloc)
inline unordered_multimap(std::initializer_list<value_type> il)
inline unordered_multimap(std::initializer_list<value_type> il, size_type n, const hasher &hf = hasher(), const key_equal &eql = key_equal(), const allocator_type &alloc = allocator_type())
inline unordered_multimap(std::initializer_list<value_type> il, size_type n, const allocator_type &alloc)
inline unordered_multimap(std::initializer_list<value_type> il, size_type n, const hasher &hf, const allocator_type &alloc)
this_t &operator=(const this_t&) = default
this_t &operator=(this_t&&) = default
inline proxy_t operator[](const Key &k)

Private Types

using this_t = unordered_multimap<Key, T, Ts...>
using base_t = std::unordered_multimap<Key, T, Ts...>
using proxy_t = MapProxy<std::decay_t<T>>