diff options
author | Derek Mauro <dmauro@google.com> | 2024-04-04 08:04:25 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-04 08:05:38 -0700 |
commit | 377de9d710c69a8bd6fdfc67ab3aa71d5f987251 (patch) | |
tree | 2acd4085735851114aae958dd242c9bd2ea0c955 /absl/utility/utility_test.cc | |
parent | d5e426097680beafbf72d6c88f50a680736ec770 (diff) | |
download | abseil-377de9d710c69a8bd6fdfc67ab3aa71d5f987251.tar.gz abseil-377de9d710c69a8bd6fdfc67ab3aa71d5f987251.tar.bz2 abseil-377de9d710c69a8bd6fdfc67ab3aa71d5f987251.zip |
Deprecate `absl::exchange`, `absl::forward` and `absl::move`, which
were only useful before C++14.
Callers should use `std::exchange`, `std::forward` and `std::move`
instead.
One thing to note is that some compilers issue warnings about pessimizing
and redundant moves. Some compilers were able to apply this analysis to
std::move but not absl::move. If you get a warning about one of these issues
now that absl::move is an alias for std::move, you should remove this use of
move.
See https://developers.redhat.com/blog/2019/04/12/understanding-when-not-to-stdmove-in-c
PiperOrigin-RevId: 621861324
Change-Id: I60f98b59be5ff425bd17fbce43d9218c361720c2
Diffstat (limited to 'absl/utility/utility_test.cc')
-rw-r--r-- | absl/utility/utility_test.cc | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/absl/utility/utility_test.cc b/absl/utility/utility_test.cc index 1af68136..c540b22f 100644 --- a/absl/utility/utility_test.cc +++ b/absl/utility/utility_test.cc @@ -205,14 +205,6 @@ TEST(ApplyTest, FlipFlop) { EXPECT_EQ(42, absl::apply(&FlipFlop::member, std::make_tuple(obj))); } -TEST(ExchangeTest, MoveOnly) { - auto a = Factory(1); - EXPECT_EQ(1, *a); - auto b = absl::exchange(a, Factory(2)); - EXPECT_EQ(2, *a); - EXPECT_EQ(1, *b); -} - TEST(MakeFromTupleTest, String) { EXPECT_EQ( absl::make_from_tuple<std::string>(std::make_tuple("hello world", 5)), |