An object-like container with unique keys stored in insertion order. New keys are added at the end; existing keys retain their position.
More...
|
|
| ordered_object (const ordered_object &)=default |
| |
|
| ordered_object (ordered_object &&) noexcept=default |
| |
|
ordered_object & | operator= (const ordered_object &other) |
| |
|
ordered_object & | operator= (ordered_object &&) noexcept=default |
| |
|
| ordered_object (std::initializer_list< std::pair< const key_type, Value > > initializer_list) |
| |
|
ordered_object & | operator= (std::initializer_list< std::pair< const key_type, Value > > initializer_list) |
| |
| Value & | operator[] (const key_type &key) |
| | Return the value for a key, adding a new key at the end if it does not exist. Updating an existing key does not change its position.
|
| |
|
iterator | find (const key_type &key) |
| |
|
const_iterator | find (const key_type &key) const |
| |
| std::size_t | count (const key_type &key) const |
| | Return the count of a key, which is either zero or one.
|
| |
|
bool | contains (const key_type &key) const |
| |
| iterator | begin () |
| | Return an iterator to the first entry in insertion order.
|
| |
|
iterator | end () |
| |
|
const_iterator | begin () const |
| |
|
const_iterator | end () const |
| |
| template<typename K , typename V > |
| std::pair< iterator, bool > | emplace (K &&key, V &&value) |
| | Insert a key-value pair at the end if the key is not already present. Existing keys are ignored.
|
| |
| template<typename InputIt > |
| void | insert (InputIt first, InputIt last) |
| | Insert new keys from a range in input order; existing keys are ignored.
|
| |
|
void | clear () |
| |
|
std::size_t | size () const |
| |
template<typename Key, typename Value>
class crow::ordered_object< Key, Value >
An object-like container with unique keys stored in insertion order. New keys are added at the end; existing keys retain their position.
- Template Parameters
-
| Key | the key type |
| Value | the mapped value type |