|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-02-08 15:04:04
Daniel Wallin <dalwan01_at_[hidden]> writes:
> With Mojo you would do something like:
>
> struct X : moveable<X>
> {
> X(X&);
> X(constant_ref<X>);
> X(rvalue_ref<X>); // move constructor
> };
>
> And it would always move from rvalues.
Meaning that you could pass an X rvalue by-value to an X parameter
without any deep copying?
> The intrusive part was that to
> solve the whole "binding rvalues to const&" problem you needed to return
> some special wrapper type:
>
> moved<X> f();
Oh, really? Too bad; I guess this isn't really much of an innovation
then.
-- 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