nlohmann::ordered_map::at

accesses the element with the given key, with bounds checking

Synopses

Declared in <nlohmann/ordered_map.hpp>

accesses the element with the given key, with bounds checking

T&
at(key_type const& key);
» more...

accesses the element with the given key, with bounds checking

T const&
at(key_type const& key) const;
» more...

accesses the element with the given key, with bounds checking

template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T&
at(KeyType&& key);
» more...

accesses the element with the given key, with bounds checking

template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T const&
at(KeyType&& key) const;
» more...

Exceptions

NameThrown on
std::out_of_rangeif the container does not have an element with the given key

Return Value

  • reference to the value associated with key
  • const reference to the value associated with key

Parameters

NameDescription
key [in]key of the element to access