Advertisement
kolbka_

Untitled

Jan 23rd, 2022
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. TEST_CASE("unique_ptr move self-assignment of non-empty") {
  2.     int *raw_p = new int(10);
  3.     unique_ptr<int> p(raw_p);
  4.     p = std::move(p);
  5.     REQUIRE(p.get() == raw_p);  // NOLINT(bugprone-use-after-move)
  6.     REQUIRE(p);
  7.     CHECK(&*p == raw_p);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement