Boost logo

Boost :

Subject: Re: [boost] [review] Multiprecision review scheduled for June 8th - 17th, 2012
From: Marc Glisse (marc.glisse_at_[hidden])
Date: 2012-06-03 04:06:32


On Sun, 3 Jun 2012, Vicente J. Botet Escriba wrote:

> Le 03/06/12 00:10, Marc Glisse a écrit :
>> Does it need to be? mp_number is documented as copy constructible, and the
>> move constructor is just an optimization.
>>
> Well, I think so. It is an optimization that follows a given protocol, e.g.
> the use of std::move and std::forward. If no documented we can not use these
> functions, or can we?

Uh? Copying from a prvalue (say, a temporary) will automatically use that
function instead of the regular copy constructor. You can also force its
use by making an xvalue (move), but that's secondary.

> In addition the backend developers should be aware of this.

Hmm, maybe you're right, it is an optimization of the copy constructor,
but it can make sense to let developers know that if they provide it, it
will be used.

-- 
Marc Glisse

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk