[llvm] [MapVector] Introduce {keys, values} iterator, use in VPlan (PR #169675)
Graham Hunter via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 26 08:38:48 PST 2025
================
@@ -99,6 +99,26 @@ class MapVector {
return try_emplace_impl(Key).first->second;
}
+ [[nodiscard]] inline auto keys() {
+ return map_range(
+ Vector, [](const std::pair<KeyT, ValueT> &KV) { return KV.first; });
----------------
huntergr-arm wrote:
Perhaps `make_first_range` and `make_second_range` would be better than `map_range` for these functions?
https://github.com/llvm/llvm-project/pull/169675
More information about the llvm-commits
mailing list