[llvm-branch-commits] [llvm] [ADT] Add more useful methods to SmallSet API (PR #108601)

Jakub Kuderski via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 24 10:00:14 PDT 2024


================
@@ -147,6 +148,22 @@ class SmallSet {
   using const_iterator = SmallSetIterator<T, N, C>;
 
   SmallSet() = default;
+  SmallSet(const SmallSet &) = default;
+  SmallSet(SmallSet &&) = default;
+
+  template <typename IterT> SmallSet(IterT Begin, IterT End) {
+    insert(Begin, End);
+  }
+
+  template <typename RangeT>
+  explicit SmallSet(const iterator_range<RangeT> &R) {
+    insert(R.begin(), R.end());
+  }
+
+  SmallSet(std::initializer_list<T> L) { this->insert(L.begin(), L.end()); }
----------------
kuhar wrote:

One remaining `this->`

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


More information about the llvm-branch-commits mailing list