|
Boost : |
Subject: Re: [boost] [unique_ptr] So how is it used differently?
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2008-12-22 12:18:53
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk