[#nlohmann-ordered_map-emplace-01] = xref:nlohmann.adoc[nlohmann]::xref:nlohmann/ordered_map.adoc[ordered_map]::emplace :relfileprefix: ../../ :mrdocs: inserts a new element constructed from _key_ and _t_ if the key does not already exist == Synopses Declared in `<nlohmann/ordered_map.hpp>` inserts a new element constructed from _key_ and _t_ if the key does not already exist [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> xref:nlohmann/ordered_map/emplace-0d.adoc[emplace]( xref:nlohmann/ordered_map/key_type.adoc[key_type] const& key, T&& t); ---- [.small]#xref:nlohmann/ordered_map/emplace-0d.adoc[_» more..._]# inserts a new element constructed from _key_ and _t_ if the key does not already exist [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value std::pair<iterator, bool> xref:nlohmann/ordered_map/emplace-0b.adoc[emplace]( KeyType&& key, T&& t); ---- [.small]#xref:nlohmann/ordered_map/emplace-0b.adoc[_» more..._]# == Return Value pair of an iterator to the (possibly pre‐existing) element and a bool that is true if the insertion took place == Parameters [cols="1,4"] |=== | Name| Description | *key* [in] | key of the element to insert | *t* [in] | value of the element to insert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#