File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,19 @@ class FrozenMultiMap {
246
246
auto optRange = makeOptionalTransformRange (baseRange, ToNonErasedValues ());
247
247
return makeTransformRange (optRange, PairWithTypeErasedOptionalSecondElt ());
248
248
}
249
+
250
+ // / Returns true if all values for all keys have been deleted.
251
+ // /
252
+ // / This is intended to be used in use cases where a frozen multi map is
253
+ // / filled up with a multi-map and then as we process keys, we delete values
254
+ // / we have handled. In certain cases, one wishes to validate after processing
255
+ // / that all values for all keys were properly handled. One cannot perform
256
+ // / this operation with getRange() in a nice way.
257
+ bool allValuesHaveBeenDeleted () const {
258
+ return llvm::all_of (storage, [](const std::pair<Key, Optional<Value>> &pair) {
259
+ return !pair.second .hasValue ();
260
+ });
261
+ }
249
262
};
250
263
251
264
template <typename Key, typename Value, typename Storage>
You can’t perform that action at this time.
0 commit comments