[PATCH] D47942: [SmallSet] Add SmallSetIterator.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 14:42:45 PDT 2018


dblaikie added inline comments.


================
Comment at: include/llvm/ADT/SmallSet.h:32
+template <typename T, unsigned N, typename C>
+class SmallSetIterator
+    : public iterator_facade_base<SmallSetIterator<T, N, C>,
----------------
fhahn wrote:
> dblaikie wrote:
> > I imagine this type needs user-defined special members (copy/move ctors and copy/move assignment operators) - the usual "rule of 5" (the user-defined dtor being an indicator here)
> It looks like both the set and SmallVector iterators have trivial ctors/dtors and move/assignment operators. So it seems like the destructor is not needed either, at least the compiler does not complain about any missing functions. Would it be safe to get rid of the dtor instead in this case?
Might be OK to remove them if you add in some static_asserts that all the relevant members (all 5) are trivial?



https://reviews.llvm.org/D47942





More information about the llvm-commits mailing list