21 explicit LruSet(size_t max_size,
const Hash& hash = Hash(),
const Equal& equal = Equal())
22 : impl_(max_size, hash, equal)
25 LruSet(LruSet&& lru)
noexcept =
default;
26 LruSet(
const LruSet& lru) =
delete;
27 LruSet& operator=(LruSet&& lru)
noexcept =
default;
28 LruSet& operator=(
const LruSet& lru) =
delete;
32 bool Put(
const T& key) {
return impl_.Put(key, {}); }
35 void Erase(
const T& key) {
return impl_.Erase(key); }
38 bool Has(
const T& key) {
return impl_.Get(key); }
41 void SetMaxSize(size_t new_max_size) {
return impl_.SetMaxSize(new_max_size); }
47 template <
typename Function>
49 impl_.VisitAll([&func](
const auto& key,
const auto& )
mutable { func(key); });
52 size_t GetSize()
const {
return impl_.GetSize(); }
60 impl::LruBase<T, impl::EmptyPlaceholder, Hash, Equal> impl_;