fixed erase_if(x,f) return value calculation

This commit is contained in:
joaquintides
2023-03-31 17:28:21 +02:00
parent e9b3ad4a5f
commit 863984a7c8

View File

@ -555,14 +555,17 @@ public:
{
auto lck=shared_access();
auto hash=this->hash_for(x);
return (std::size_t)unprotected_internal_visit(
std::size_t res=0;
unprotected_internal_visit(
group_exclusive{},x,this->position_for(hash),hash,
[&,this](group_type* pg,unsigned int n,element_type* p)
{
if(f(cast_for(group_exclusive{},type_policy::value_from(*p)))){
super::erase(pg,n,p);
res=1;
}
});
return res;
}
template<typename F>