Boost logo

Boost :

From: Andrea Torsello (torsello_at_[hidden])
Date: 2004-04-19 11:54:13

David Abrahams wrote:
> My library is not relying on it being enough. It's just turning off
> the mechanisms needed for non-RVO'ing compilers where appropriate.

This is clearly the best thing, which leaves us where we do not provide any
X(X const &) constructor (explicit or implicit) unless the compiler
requires it.
>>>> You still need to convert to temporary in initializer lists, since
>>>> you cannot use the assigment constructor there, but most likely you
>>>> would have to do it anyway.
> That's what the explicit "move(x)" function is for:

exactly, my point was that in initialization lists you probably need to
convert to temporary with the move(x) function. By "convert to temporary" I
meant the X::temporary type I had in my examples. The move_from<X> type in
your code.

> Considering that most/all of my ctors' logic is in the initializer
> list and that the two ctors' initializers will be different, I like
> having a way to make them the same.
>> Yes users would still have to provide the initializer lists.
> Only one initializer list need be provided, using implicit_cast<> if
> neccessary.

With complicated initializer lists, I agree that one doesn't want to
duplicate the list. I guess that this is a personal coding-style issue.

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