Template Struct ordered_map

Inheritance Relationships

Base Type

  • public std::vector< std::pair< const Key, T >, std::allocator< std::pair< const Key, T > > >

Struct Documentation

template<class Key, class T, class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
struct ordered_map : public std::vector<std::pair<const Key, T>, std::allocator<std::pair<const Key, T>>>

ordered_map: a minimal map-like container that preserves insertion order for use within nlohmann::basic_json<ordered_map>

Public Types

using key_type = Key
using mapped_type = T
using Container = std::vector<std::pair<const Key, T>, Allocator>

Public Functions

inline ordered_map(const Allocator &alloc = Allocator())
template<class It>
inline ordered_map(It first, It last, const Allocator &alloc = Allocator())
inline ordered_map(std::initializer_list<T> init, const Allocator &alloc = Allocator())
inline std::pair<iterator, bool> emplace(const key_type &key, T &&t)
inline T &operator[](const Key &key)
inline const T &operator[](const Key &key) const
inline T &at(const Key &key)
inline const T &at(const Key &key) const
inline size_type erase(const Key &key)
inline iterator erase(iterator pos)
inline size_type count(const Key &key) const
inline iterator find(const Key &key)
inline const_iterator find(const Key &key) const
inline std::pair<iterator, bool> insert(value_type &&value)
inline std::pair<iterator, bool> insert(const value_type &value)