Boost logo

Boost :

Subject: Re: [boost] [unique_ptr] So how is it used differently?
From: Sid Sacek (heavyreign_at_[hidden])
Date: 2008-12-22 21:21:42


Thank you Sebastian and Mathias...

Thank was very helpful and useful.

Regards,
-Sid Sacek

-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
On Behalf Of Mathias Gaunard
Sent: Monday, December 22, 2008 9:05 PM
To: boost_at_[hidden]
Subject: Re: [boost] [unique_ptr] So how is it used differently?

Sid Sacek wrote:

> 1) When would I choose unique_ptr<> over auto_ptr<> ?

Always.
auto_ptr is deprecated and is dangerous.

unique_ptr, for example, perfectly works with containers.

> 2) When would I choose unique_ptr<> over scoped_ptr<> ?

Whenever you need the ability to move.
You can choose to always use it instead of scoped_ptr, that's perfectly
safe and doesn't add any overhead.

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk