[PATCH] D96134: [ADT] Allow SmallPtrSet to be used with a std::insert_iterator

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 12:37:21 PST 2021


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/unittests/ADT/SmallPtrSetTest.cpp:407
+  // Ensure that we can use SmallPtrSet with std::inserter().
+  std::copy(std::begin(Buf), std::end(Buf), std::inserter(Set, Set.begin()));
+
----------------
I'd probably/prefer to make a direct call to the API, rather than testing it through a bunch of other container machinery. More isolated testing, clearer failures (not layers of template goo inside the standard library), etc.

 (& my minor preference is towards using member begin/end unless the fully generic ADL call is needed (in which case you need llvm::adl_* functions or the raw using+unqualified call))


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96134/new/

https://reviews.llvm.org/D96134



More information about the llvm-commits mailing list