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?
March 18-23, Tokyo, Japan
April 17-20, Bristol, UK
April 24-26, Leganes, Spain
April 30, Online
May 7-12, Aspen, CO, USA
June 24-29, St. Louis, MO, USA
July 2-5, Folkestone, Kent, UK
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.