diff --git a/src/groups/mqb/mqbs/mqbs_storagecollectionutil.cpp b/src/groups/mqb/mqbs/mqbs_storagecollectionutil.cpp index d5222e3c20..5e0b5c1bdb 100644 --- a/src/groups/mqb/mqbs/mqbs_storagecollectionutil.cpp +++ b/src/groups/mqb/mqbs/mqbs_storagecollectionutil.cpp @@ -156,6 +156,31 @@ void StorageCollectionUtil::loadStorages(StorageList* storages, } } +namespace { + +template +struct Not1 { + Not1(const Predicate& predicate) + : d_predicate(predicate) + { + } + + template + bool operator()(const Value& value) const + { + return !d_predicate(value); + } + Predicate d_predicate; +}; + +template +Not1 not_pred(const Predicate& predicate) +{ + return Not1(predicate); +} + +} // close anonymous namespace + void StorageCollectionUtil::filterStorages(StorageList* storages, const StorageFilter& filter) { @@ -164,7 +189,7 @@ void StorageCollectionUtil::filterStorages(StorageList* storages, StorageListIter iter = bsl::remove_if(storages->begin(), storages->end(), - bsl::not1(filter)); + not_pred(filter)); storages->erase(iter, storages->end()); }