policy_cache.hpp

This commit is contained in:
Antonio SJ Musumeci 2024-02-16 00:11:45 -06:00
parent b98a8689f3
commit a2e7a4d040

View File

@ -38,13 +38,14 @@ public:
} }
public: public:
void const
std::string*
insert(std::string const &key_, insert(std::string const &key_,
std::string &val_) std::string &val_)
{ {
if(_cache.size() > _max_size) if(_cache.size() > _max_size)
_cache.erase(_cache.begin()); _cache.erase(_cache.begin());
_cache.insert({key_,val_}); return &_cache.insert({key_,val_}).first;
} }
const const