[PATCH] D83902: [ADT] Add a range-based version of std::move
Endre Fülöp via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 17 12:13:17 PDT 2020
gamesh411 added a comment.
I am happy to see this change, as I could use it inside my clang-tidy check as well!
================
Comment at: llvm/unittests/ADT/STLExtrasTest.cpp:582
+
+ // Ensure input container is same size, but its contents were moved out.
+ EXPECT_EQ(In.size(), ItemCount);
----------------
We could implement a dummy class here in the test code with an explicit move and copy ctors and assignment operators to not depend on the behaviour of std::string. That's because if small-string optimization is employed in the implementation of std::string, it is perfectly valid, and thus possible that the 'valid but unspecified' state of the moved-from string is not empty.
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