Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2002-07-08 13:07:33


On Mon, 2002-07-08 at 11:56, David Abrahams wrote:
>
> > For the doc, there is a simple problem: The docs say that the Supplied
> > Operations looks like this:
> >
> > T operator+(T, const T&)
> >
> > changing the return type to const is straight forward, but the
> > parameters depend on the compiler (or even worse, the compiler version
> > and the user-config). I currently plan to replace the above line with
> >
> > const T operator+(const T&, const T&)
> >
> > and add a footnote to all operators that depend on the NRVO-settings.
>
> OK. In the standard we could handle that with the as-if rule and the fact
> that the user can't reliably take the address of a library-supplied
> function, but your way seems simpler.

Well, I added the option to force the implementation to create the
documented signature, you just have to set
BOOST_FORCE_SYMMETRIC_OPERATORS. It would IMO be an unnecessary
restriction to forbid taking the address.

Currently, I have a 36K patch that should be appliable to the
boost_1_28_0 directory. It adds the new operator.hpp, regression tests
and documentation. It only patches the compiler-config for the gcc, as
it is the only compiler that has the NRVO. I use a positive indicator
(BOOST_HAS_NRVO) instead of a negative (BOOST_NO_NRVO) for simplicity
now. Shall I post the patch here, send it to you privately or check it
in to the files section?

Regards, Daniel


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