a minimal map‐like container that preserves insertion order
Synopsis
Declared in <nlohmann/ordered_map.hpp>
template<
class Key,
class T,
class IgnoredLess = std::less<Key>,
class Allocator = std::allocator<std::pair<Key const, T>>>
struct ordered_map
: std::vector<std::pair<Key const, T>, Allocator>
Description
ordered_map: a minimal map‐like container that preserves insertion order for use within nlohmann::basic_json<ordered_map>
Base Classes
Name |
Description |
|
A standard container which offers fixed time access to individual elements in any order. |
Type Aliases
Name |
Description |
the underlying container type used to store the key‐value pairs |
|
a const iterator over the underlying container |
|
an iterator over the underlying container |
|
the comparison function used to determine whether two keys are equal |
|
the type of the keys stored in the map |
|
the type of the values mapped to each key |
|
helper type that is only defined if InputIt qualifies as an input iterator, used to constrain the iterator‐range overload of |
|
an unsigned integer type used to represent sizes and counts |
|
the type of the key‐value pairs stored in the underlying container |
Member Functions
Name |
Description |
|
Constructors |
|
destructor |
Assignment operators |
|
accesses the element with the given key, with bounds checking |
|
returns the number of elements matching the given key |
|
inserts a new element constructed from key and t if the key does not already exist |
|
|
|
finds an element with the given key |
|
|
|
Subscript operators |
Created with MrDocs