Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-02-24 16:24:10


"Fernando Cacciola \(Home\)" <fernando_cacciola_at_[hidden]> writes:

> optional<Window> opt( in_place<Window>(point(0,0),point(10,10)));
>
> here, in_place() is used to forward T's ctor argument to optional<> so that
> T is effectively constructed in-place right within the aligned storage.
>
> Is this what you want?

I have to say that I like the idea of using placement-new with an
optional<> argument better, since it doesn't get you involved with
the const ref/non-const ref/rvalue forwarding problem.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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