Boost logo

Boost :

Subject: Re: [boost] unique_ptr, was: Composing non copyable and movable classes
From: David Abrahams (dave_at_[hidden])
Date: 2008-12-18 16:20:07


on Thu Dec 18 2008, Sebastian Redl <sebastian.redl-AT-getdesigned.at> wrote:

>
> Another weakness - at least in my implementation - is that implicit conversions on
> return don't work. This is not a problem for unique_ptr, really, but it is for my more
> complex pointers.
>
> OwningStmtResult foo()
> {
> return true; // OwningStmtResult has an implicit conversion from bool.
> }
>
> This fails to compile.

IIRC, if you look around the web you can find an implementation of
"move_ptr" by Jonathan Turkanis that does a perfect emulation.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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