[#nlohmann-ordered_map-at-07] = xref:nlohmann.adoc[nlohmann]::xref:nlohmann/ordered_map.adoc[ordered_map]::at :relfileprefix: ../../ :mrdocs: 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 [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T& xref:nlohmann/ordered_map/at-036.adoc[at](xref:nlohmann/ordered_map/key_type.adoc[key_type] const& key); ---- [.small]#xref:nlohmann/ordered_map/at-036.adoc[_» more..._]# accesses the element with the given key, with bounds checking [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T const& xref:nlohmann/ordered_map/at-08.adoc[at](xref:nlohmann/ordered_map/key_type.adoc[key_type] const& key) const; ---- [.small]#xref:nlohmann/ordered_map/at-08.adoc[_» more..._]# accesses the element with the given key, with bounds checking [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T& xref:nlohmann/ordered_map/at-033.adoc[at](KeyType&& key); ---- [.small]#xref:nlohmann/ordered_map/at-033.adoc[_» more..._]# accesses the element with the given key, with bounds checking [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T const& xref:nlohmann/ordered_map/at-00.adoc[at](KeyType&& key) const; ---- [.small]#xref:nlohmann/ordered_map/at-00.adoc[_» more..._]# == Exceptions [cols="1,4"] |=== | Name| Thrown on | `std::out_of_range` | if 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 [cols="1,4"] |=== | Name| Description | *key* [in] | key of the element to access |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#