[llvm] [ADT] Add DenseSet::insert_range (PR #131567)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 17 09:37:55 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));
----------------
kuhar wrote:

something like `set.insert_range(std::move(foo))` where foo contains types that dynamically allocate

https://github.com/llvm/llvm-project/pull/131567


More information about the llvm-commits mailing list