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

`insert` overloads

== Synopses

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

Same as the preceding overload, moving both `key` and `value`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Cache/insert-0b.adoc[insert](
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;KEY&gt;] key,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;VALUE&gt;] value);
----

[.small]#xref:BloombergLP/bdlcc/Cache/insert-0b.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, moving `key` into the cache&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Cache/insert-01.adoc[insert](
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;KEY&gt;] key,
    VALUE const& value);
----

[.small]#xref:BloombergLP/bdlcc/Cache/insert-01.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, moving `key` into the cache&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Cache/insert-0ce.adoc[insert](
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;KEY&gt;] key,
    xref:BloombergLP/bdlcc/Cache/ValuePtrType.adoc[ValuePtrType] const& valuePtr);
----

[.small]#xref:BloombergLP/bdlcc/Cache/insert-0ce.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, moving `value` into the cache&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Cache/insert-0c4.adoc[insert](
    KEY const& key,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;VALUE&gt;] value);
----

[.small]#xref:BloombergLP/bdlcc/Cache/insert-0c4.adoc[_» more&period;&period;&period;_]#

Move the specified `key` and its associated `value` into this cache&period; 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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Cache/insert-09.adoc[insert](
    KEY const& key,
    VALUE const& value);
----

[.small]#xref:BloombergLP/bdlcc/Cache/insert-09.adoc[_» more&period;&period;&period;_]#

Insert the specified `key` and its associated `valuePtr` into this cache&period; If `key` already exists, then its value will be replaced with `value`&period; Note that the method with `key` moved provides the `basic` but not the `strong` exception guarantee &hyphen;&hyphen; if a throw occurs, the cache will not be modified, but `key` may be changed&period; Also note that `key` must be copyable, even if it is moved&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Cache/insert-0e.adoc[insert](
    KEY const& key,
    xref:BloombergLP/bdlcc/Cache/ValuePtrType.adoc[ValuePtrType] const& valuePtr);
----

[.small]#xref:BloombergLP/bdlcc/Cache/insert-0e.adoc[_» more&period;&period;&period;_]#


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