[PATCH] D83902: [ADT] Add a range-based version of std::move

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 12:18:39 PDT 2020


dblaikie added inline comments.


================
Comment at: llvm/unittests/ADT/STLExtrasTest.cpp:584
+  EXPECT_EQ(In.size(), ItemCount);
+  EXPECT_TRUE(llvm::all_of(In, [](const auto &Str) { return Str.empty(); }));
+
----------------
Moved-from strings aren't guaranteed to be empty (they're in a "valid but unspecified" state - for small strings it's possible they still contain the original value) - probably using a specific type that counts moves/copies/destructions might help.

Range<Movable, Copyable> further up in this file provides that - but perhaps could use a refactor Maybe pull out most of the functionality (except the begin/end function) into a "LifetimeTracker" class - and then use that in this test?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83902





More information about the llvm-commits mailing list