[#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 `<bdlcc_cache.h>` Create an empty LRU cache having no size limit. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. [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..._]# Create an empty cache using the specified `evictionPolicy` and the specified `lowWatermark` and `highWatermark`. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The behavior is undefined unless `lowWatermark <= highWatermark`, `1 <= lowWatermark`, and `1 <= highWatermark`. [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_t lowWatermark, std::size_t highWatermark, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0); ---- [.small]#xref:BloombergLP/bdlcc/Cache/2constructor-0ac.adoc[_» more..._]# Create an empty cache using the specified `evictionPolicy`, `lowWatermark`, and `highWatermark`. 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. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. The behavior is undefined unless `lowWatermark <= highWatermark`, `1 <= lowWatermark`, and `1 <= highWatermark`. [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_t lowWatermark, std::size_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..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#