From: Eric Friedman (ebf_at_[hidden])
Date: 2003-09-11 02:03:21
Fernando Cacciola wrote:
> Inplace construction is now supported.
Great! I'm glad to see you got around to implementing this. I'd like to
offer it for variant as well.
> you can initialize an optional constructing its contained
> value directly in place instead of copying an existing object:
> struct A
> A ( int a, std::string s ) ;
> } ;
> boost::optional<A> opt( boost::in_place(1234,"Hellow world!") ) ;
> As you can see, the "factory expression" : in_place(...) does not
> need the optional's value_type (A in this case), so the
> syntax is terse.
Unfortunately this syntax will not work for variant. For example:
B(int a, std::string s);
boost::in_place(1234,"Hello world!") // A or B?
I'm guessing we could both have our desired syntax if there were also
boost::in_place overloads taking an explicit template argument.
Does this seem feasible to you?
P.S. Really though, I'm not sure if the following would be so terrible:
After all, it's not so different from:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk