[llvm] [ADT] Add DenseSet::insert_range (PR #131567)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 17 09:43:35 PDT 2025
================
@@ -237,6 +238,10 @@ class DenseSetImpl {
for (; I != E; ++I)
insert(*I);
}
+
+ template <typename Range> void insert_range(Range &&R) {
+ insert(adl_begin(R), adl_end(R));
----------------
kazutakahirata wrote:
Ah, I see. Thanks! In that particular case, is `insert_range` worse than `insert`? I think we'd still end with something like:
```
auto R = std::move(foo);
set.insert(adl_begin(R), adl_end(R));
```
https://github.com/llvm/llvm-project/pull/131567
More information about the llvm-commits
mailing list