Quick A: Yes. Otherwise, it would be unsafe and a lot less unique.
From SO:
Is
unique_ptrguaranteed to storenullptrafter move?std::unique_ptr<int> p1{new int{23}}; std::unique_ptr<int> p2{std::move(p1)}; assert(!p1); // is this always true?
March 11-13, Online
March 16-18, Madrid, Spain
March 23-28, Croydon, London, UK
March 30, Kortrijk, Belgium
May 4-8, Aspen, CO, USA
May 4-8, Toronto, Canada
June 8 to 13, Brno, Czechia
June 17-20, Folkestone, UK
September 12-18, Aurora, CO, USA
November 6-8, Berlin, Germany
November 16-21, Búzios, Rio De Janeiro, Brazil
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_ptrguaranteed to storenullptrafter 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.