Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-04-14 10:44:23

Joaquín Mª López Muñoz <joaquin_at_[hidden]> writes:

> David Abrahams ha escrito:
>> Hi,
>> I'm just wondering if the deafening silence indicates a lack of
>> interest or whether something else is going on?
>> Feedback would be appreciated.
> I've got move semantics supports in the roadmap for my indexed_set
> (likely to be renamed multi_index_container) library, so your code
> can be (for me at least) of great value.


> Quick questions:
> * Seems like your library does not support the temporary return
> part (I mean, the equivalent of mojo::fnresult). Is this right? If so,
> are you planning to add support for this part as well?

I don't know what you mean. That hack is unneccessary with my
library. It's non-intrusive on clients of the movable class (unless
they explicitly want to distinguish rvalue from const lvalue arguments
for moving purposes). To return a movable class rvalue efficiently,
you just return it.

Try the move.cpp test with --verbose-test on GCC to see what I mean.

> * In those classes with fast swap, is this a right approach to implement
> the move constructor?
> X(move_from<X> rhs)
> {
> this.swap(rhs);
> }

Not usually; that will default-initialize all bases and members before
doing the swap.

Dave Abrahams
Boost Consulting

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