[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 08:28:45 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) {
+    this->insert(Begin, End);
+  }
+
+  template <typename RangeT>
+  explicit SmallSet(const iterator_range<RangeT> &R) {
+    this->insert(R.begin(), R.end());
+  }
+
+  SmallSet(std::initializer_list<T> L) { this->insert(L.begin(), L.end()); }
----------------
kuhar wrote:

The rest of the code in the class doesn't use `this->` for member functions

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


More information about the llvm-branch-commits mailing list