Doubt with auto_ptr_ref

C

CID

Hello all,

I was reading about auto_ptr from TC++PL. It tells, the purpose of
auto_ptr_ref is to implement the destructive copy semantics for
ordinary auto_ptrs.

Can somebody there please explain how it achives the requirement ? I am
interested to know how auto_ptr_ref helps in transferring ownership and
how it avoids copying of const auto_ptrs.

Any help will be appreciated.
Thanks and Regards
CID
 
J

Jonathan Turkanis

CID said:
Hello all,

I was reading about auto_ptr from TC++PL. It tells, the purpose of
auto_ptr_ref is to implement the destructive copy semantics for
ordinary auto_ptrs.

Can somebody there please explain how it achives the requirement ?

It doesn't. The references cited here explain how it was supposed to work and
why it's broken:

http://www.kangaroologic.com/move_ptr/
I
am interested to know how auto_ptr_ref helps in transferring
ownership and how it avoids copying of const auto_ptrs.

Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,206
Latest member
EpifaniaMc

Latest Threads

Top