[llvm] [MapVector] Introduce {keys, values} iterator, use in VPlan (PR #169675)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 28 07:51:23 PST 2025
================
@@ -99,6 +99,11 @@ class MapVector {
return try_emplace_impl(Key).first->second;
}
+ [[nodiscard]] inline auto keys() { return make_first_range(Vector); }
+ [[nodiscard]] inline auto values() { return make_second_range(Vector); }
+ [[nodiscard]] inline auto keys() const { return make_first_range(Vector); }
+ [[nodiscard]] inline auto values() const { return make_second_range(Vector); }
----------------
fhahn wrote:
```suggestion
[[nodiscard]] inline auto keys() { return make_first_range(Vector); }
[[nodiscard]] inline auto keys() const { return make_first_range(Vector); }
[[nodiscard]] inline auto values() { return make_second_range(Vector); }
[[nodiscard]] inline auto values() const { return make_second_range(Vector); }
```
Keep values(), keys() together?
https://github.com/llvm/llvm-project/pull/169675
More information about the llvm-commits
mailing list