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

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
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);
----

== Description

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;

== Parameters

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


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