[#BloombergLP-bdlcc-Cache-insert-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/Cache.adoc[Cache]::insert
:relfileprefix: ../../../
:mrdocs:

Insert the specified `key` and its associated `value` into this cache&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;cache&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
insert(
    KEY const& key,
    VALUE const& value);
----

== Description

If `key` already exists, then its value will be replaced with `value`&period; Note that all the methods that take moved objects provide the `basic` but not the `strong` exception guarantee &hyphen;&hyphen; throws may occur after the objects are moved out of&semi; the cache will not be modified, but `key` or `value` may be changed&period; Also note that `key` must be copyable, even if it is moved&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to insert
| *value*
| value associated with `key`
|===


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