
22 Dec
2008
22 Dec
'08
5:18 p.m.
Sid Sacek wrote:
What I'm curious about is two things...
1) When would I choose unique_ptr<> over auto_ptr<> ?
Always. unique_ptr is the same idea as auto_ptr, but with a safe implementation.
2) When would I choose unique_ptr<> over scoped_ptr<> ?
When ownership is transferred away from the scope of allocation, either downscope (passed into a function) or upscope (returned from a function). Sebastian