[#BloombergLP-bdlcc-Cache-2constructor-0a7]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/Cache.adoc[Cache]::Cache
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create an empty LRU cache having no size limit&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlcc/Cache/2constructor-0c.adoc[Cache](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create an empty cache with the specified eviction policy and watermarks&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlcc/Cache/2constructor-0ac.adoc[Cache](
    xref:BloombergLP/bdlcc/CacheEvictionPolicy/Enum.adoc[CacheEvictionPolicy::Enum] evictionPolicy,
    std::size&lowbar;t lowWatermark,
    std::size&lowbar;t highWatermark,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create an empty cache with custom hash and equality functors&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlcc/Cache/2constructor-01.adoc[Cache](
    xref:BloombergLP/bdlcc/CacheEvictionPolicy/Enum.adoc[CacheEvictionPolicy::Enum] evictionPolicy,
    std::size&lowbar;t lowWatermark,
    std::size&lowbar;t highWatermark,
    HASH const& hashFunction,
    EQUAL const& equalFunction,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *basicAllocator*
| allocator used to supply memory
| *evictionPolicy*
| policy used to select items for eviction
| *lowWatermark*
| size at which eviction stops
| *highWatermark*
| size at which eviction starts after an insert
| *hashFunction*
| hash functor applied to keys
| *equalFunction*
| equality functor applied to keys
|===


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