policy_cache.hpp

This commit is contained in:
Antonio SJ Musumeci 2024-03-11 20:55:46 -05:00
parent 1c4150a853
commit 3d7473e275

View file

@ -44,14 +44,14 @@ public:
insert(std::string const &key_,
std::string const &val_)
{
while(_cache.size() > _max_size)
{
std::string key;
_cache.cvisit_while([&](Map::value_type const &v_)
{
key = v_.first;
return false;
});
// while(_cache.size() > _max_size)
// {
// std::string key;
// _cache.cvisit_while([&](Map::value_type const &v_)
// {
// key = v_.first;
// return false;
// });
_cache.erase(key);
}