[#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; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&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 using the specified `evictionPolicy` and the specified `lowWatermark` and `highWatermark`&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless `lowWatermark &lt;&equals; highWatermark`, `1 &lt;&equals; lowWatermark`, and `1 &lt;&equals; highWatermark`&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 using the specified `evictionPolicy`, `lowWatermark`, and `highWatermark`&period; The specified `hashFunction` is used to generate the hash values for a given key, and the specified `equalFunction` is used to determine whether two keys have the same value&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; The behavior is undefined unless &grave;lowWatermark &lt;&equals; highWatermark`, `1 &lt;&equals; lowWatermark`, and `1 &lt;&equals; highWatermark&grave;&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;_]#


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