In the following snippet:
std::vector<double> a(100, 4.2);
auto* a_ptr = a.data();
auto b = std::move(a);
auto* b_ptr = b.data();
std::cout << ((b_ptr == a_ptr) ? "TRUE" : "FALSE") << '\n';
does the C++ standard guarantee that b_ptr
is always equal to a_ptr
after std::move
? Running the code on wandbox prints TRUE
.
std::vector
? – Wareroom