[#nlohmann-ordered_map-erase-0c7]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/ordered_map.adoc[ordered&lowbar;map]::erase
:relfileprefix: ../../
:mrdocs:

removes the element with the given key, if it exists

== Synopsis

Declared in `&lt;nlohmann&sol;ordered&lowbar;map&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class KeyType&gt;
requires detail&colon;&colon;is&lowbar;usable&lowbar;as&lowbar;key&lowbar;type&lt;key&lowbar;compare, key&lowbar;type, KeyType&gt;&colon;&colon;value
xref:nlohmann/ordered_map/size_type.adoc[size&lowbar;type]
erase(KeyType&& key);
----

== Return Value

number of elements removed (0 or 1)

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key* [in]
| key of the element to remove
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
