Boost logo

Boost :

Subject: Re: [boost] [multiprecision] Some rvalue reference experiments (performance inhancements #1)
From: Marc Glisse (marc.glisse_at_[hidden])
Date: 2012-06-30 13:17:22


On Sat, 30 Jun 2012, John Maddock wrote:

> I've started to work through some of the points that came up in the
> multiprecision review, starting with further rvalue reference support.
>
> The idea (due to Marc Glisse) was to add operator overloads that look
> something like:
>
> Number&& operator+(Number&&a, const Number& b)
> {
> return static_cast<Number&&>(a += b);
> }

The safe solution is returning Number, not Number&&. If Dave reads this
message, he can probably point us to previous discussions about this.
Being able to return Number&& would be great...

Note that changing the return type from Number&& to Number cancels the
allocation gain when using a type like GMP that doesn't have an empty
state.

-- 
Marc Glisse

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