
8 Feb
2004
8 Feb
'04
8:04 p.m.
Daniel Wallin <dalwan01@student.umu.se> 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