M
Mohammad
Is there a difference between smart pointers and automatic pointers or
they refer to the same idea.
-Thanks
they refer to the same idea.
-Thanks
Is there a difference between smart pointers and automatic pointers or
they refer to the same idea.
Alf said:* Mohammad:
Can you give an example of what you mean by 'automatic pointer'?
Victor Bazarov said:Just a guess here: the standard template class is called auto_ptr,
perhaps that's where the "automatic" comes from...
Jonathan Turkanis said:I'd guess it means a pointer which deletes the managed pointer when it
is destroyed, with no sharing or transfer of ownership allowed -- like
boost::scoped_ptr. Just a guess.
Victor Bazarov said:Actually, the transfer of ownership does occur in the copy-c-tor, IIRC.
That's how it can be returned from a function.
Jonathan Turkanis said:Your talking about auto_ptr, right? I was talking about
boost::scoped_ptr, which is non-copyable.
Jonathan
Mohammad said:"Jonathan Turkanis" <[email protected]> wrote in message
My impression has been the auto_ptr is the standard library
implementation of the smart pointer concept. com_ptr_t and ComPtr are
more sophisticated ATL implementations. During a conversation with
some one who I think has more experience with C++ than I have, he used
the term 'automatic pointer' which I thought is the same as 'smart
pointer.' So I was just trying to know if I'm correct or not.
Thanks
Mohammad said:Is there a difference between smart pointers and automatic pointers or
they refer to the same idea.
My impression has been the auto_ptr is the standard library
implementation of the smart pointer concept.
com_ptr_t and ComPtr are
more sophisticated ATL implementations. During a conversation with
some one who I think has more experience with C++ than I have, he used
the term 'automatic pointer' which I thought is the same as 'smart
pointer.' So I was just trying to know if I'm correct or not.
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.