Quick A: Yes. Otherwise, it would be unsafe and a lot less unique.
From SO:
Is
unique_ptr
guaranteed to storenullptr
after move?std::unique_ptr<int> p1{new int{23}}; std::unique_ptr<int> p2{std::move(p1)}; assert(!p1); // is this always true?
February 10-15, Hagenberg, Austria
March 19-21, Madrid, Spain
April 1-4, Bristol, UK
June 16-21, Sofia, Bulgaria
By Blog Staff | Jun 13, 2014 03:10 AM | Tags: basics
Quick A: Yes. Otherwise, it would be unsafe and a lot less unique.
From SO:
Is
unique_ptr
guaranteed to storenullptr
after move?std::unique_ptr<int> p1{new int{23}}; std::unique_ptr<int> p2{std::move(p1)}; assert(!p1); // is this always true?
There are currently no comments on this entry.
Add a Comment
Comments are closed.