Boost logo

Boost :

Subject: Re: [boost] [Multiprecision] Does MP use references internally?
From: Daryle Walker (darylew_at_[hidden])
Date: 2013-06-20 14:04:11


Nearly all operators, besides assigning and dereferencing ones, are supposed to return by value. Changing that, even with the “innocuous” (unary)+, is surprising.


Daryle W.



Sent from Windows Mail



From: John Maddock
Sent: ‎Thursday‎, ‎June‎ ‎20‎, ‎2013 ‎4‎:‎13‎ ‎AM
To: boost_at_[hidden]


> Is Boost.MP giving users references-to-types instead of class types when
> requesting a numeric type? Pointers may be objects in and of themselves,
> but references aren't; they're just aliases; trying to intentionally use
> them as first-class objects is arguably broken.

I don't see why this is a problem, but the first error is coming from:

    auto const aa = +a, bb = +b;

Now, in Boost.Multiprecision the unary operator+ is a noop that returns a
reference to self, could that be a cause of the issue?


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