Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

unique_ptr syntax

 unique_ptr<A> ptr1 (new A);
// Error: can't copy unique_ptr
 unique_ptr<A> ptr2 = ptr1; 
 // Works, resource now stored in ptr2
unique_ptr<A> ptr2 = move(ptr1); 
 
PREVIOUS NEXT
Tagged: #syntax
ADD COMMENT
Topic
Name
8+7 =