Template Class OrderedMap#

Class Documentation#

template<typename K, typename V, typename Hash = std::hash<K>, typename KeyEqual = std::equal_to<K>>
class OrderedMap#

An STL-like map that preserves insertion order.

Note

we don’t support erase since it is less needed and vector backing is more efficient.

Template Parameters:
  • K – The key type.

  • V – The value type.

  • Hash – The hash function.

  • KeyEqual – The key equality function.

Public Functions

OrderedMap() = default#
inline OrderedMap(const OrderedMap<K, V, Hash, KeyEqual> &other)#
inline OrderedMap &operator=(const OrderedMap<K, V, Hash, KeyEqual> &other)#
OrderedMap(OrderedMap<K, V, Hash, KeyEqual>&&) = default#
OrderedMap &operator=(OrderedMap<K, V, Hash, KeyEqual>&&) = default#
template<typename Iter>
inline OrderedMap(Iter begin, Iter end)#
inline auto find(const K &k)#
inline auto find(const K &k) const#
inline V &operator[](const K &k)#
inline void insert(const K &k, V v)#
inline void clear()#
inline size_t count(const K &k) const#
inline auto begin() const#
inline auto end() const#
inline auto begin()#
inline auto end()#
inline size_t size() const#
inline bool empty() const#
inline void reserve(size_t n)#