unique ptr syntax

Solutions on MaxInterview for unique ptr syntax by the best coders in the world

showing results for - "unique ptr syntax"
Lautaro
12 Jul 2016
1 unique_ptr<A> ptr1 (new A);
2// Error: can't copy unique_ptr
3 unique_ptr<A> ptr2 = ptr1; 
4 // Works, resource now stored in ptr2
5unique_ptr<A> ptr2 = move(ptr1); 
queries leading to this page
unique ptr syntaxunique ptr syntax