Skip to content

Commit b81fc00

Browse files
committed
[frozen-multi-map] Add the ability to iterate through the internal storage of the map once we have been frozen.
The intention is that this can be used once we are no longer accumulating into the multi-map.
1 parent 8e0aeff commit b81fc00

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

include/swift/Basic/FrozenMultiMap.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,26 @@ class FrozenMultiMap {
259259
return !pair.second.hasValue();
260260
});
261261
}
262+
263+
typename VectorStorage::iterator vector_begin() {
264+
assert(isFrozen() && "Can only call this in map mode");
265+
return storage.begin();
266+
}
267+
268+
typename VectorStorage::iterator vector_end() {
269+
assert(isFrozen() && "Can only call this in map mode");
270+
return storage.end();
271+
}
272+
273+
typename VectorStorage::const_iterator vector_begin() const {
274+
assert(isFrozen() && "Can only call this in map mode");
275+
return storage.begin();
276+
}
277+
278+
typename VectorStorage::const_iterator vector_end() const {
279+
assert(isFrozen() && "Can only call this in map mode");
280+
return storage.end();
281+
}
262282
};
263283

264284
template <typename Key, typename Value, typename Storage>

0 commit comments

Comments
 (0)