D
digz
Hi,
The std::auto_ptr 14.4.2 in Stroustrup ,the book talks about
"std::auto_pt_ref is to implement destructive copy semantics" , after
some more search I found that auto_ptr can be returned from function
by value,
and the class auto_ptr_ref is used to achieve that., beyond that the
workings are not mentioned. Can someone help me understand, why is an
auto_ptr_ref needed to return auto_ptr from a function, why is it
different from a normal return statement.
Thx
Digz
The std::auto_ptr 14.4.2 in Stroustrup ,the book talks about
"std::auto_pt_ref is to implement destructive copy semantics" , after
some more search I found that auto_ptr can be returned from function
by value,
and the class auto_ptr_ref is used to achieve that., beyond that the
workings are not mentioned. Can someone help me understand, why is an
auto_ptr_ref needed to return auto_ptr from a function, why is it
different from a normal return statement.
Thx
Digz