Boost logo

Boost :

Subject: Re: [boost] [move][container] Review Request (new versions of Boost.Move and Boost.Container in sandbox and vault)
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-08-12 15:53:53

David Abrahams escribió:

> Only in assignments?
> what about
> consume(produce())
> scenarios?

obj produce() { return obj(); }

void consume(obj ){}

int main()
    return 0;

At least in MSVC 7.1, GCC 4.3 and Intel 10.0 (which is EDG 3.8,
this produces just a default constructor and no calls to copy
constructor. And the same happens with:

    obj o = produce();
    obj o(produce());

>> This is not the case with constructors (the original Klaus Triendl proposal included
>> them, because it terribly
>> uglifies syntax
> Are you sure you've looked at all the alternatives? Every move library
> I'm aware of before yours supports implicitly move constructing from
> non-const rvalues.

Well, I can't say I've looked all of them ;-). I think this alternative
is one of the most balanced ones, and allows writing optimal code for
c++0x compilers without creating temporaries.



Boost list run by bdawes at, gregod at, cpdaniel at, john at