octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Remove all do_inplace* logic from C++


From: Jordi Gutiérrez Hermoso
Subject: Remove all do_inplace* logic from C++
Date: Wed, 15 May 2013 11:36:46 -0400

Now that I've actually gotten bitten by this, I want to fix it:

    https://savannah.gnu.org/bugs/?38466

But now I remember why I did it this way in the first place. An
erstwhile Octave developer had decided to dubiously optimise Octave's
in-place operators (i.e. "a OP= b" instead of "a = a OP b") to
actually also be written in-place in C++. However, after doing some
testing by compiling with g++ -O2 and decompiling the results, it
looks like gcc is smart enough to compile both "a OP= b" and "a = b OP
a" into the same damn thing. My test was simplistic, but I don't think
there is any actual benefit to using in-place operators in C++, and
they're needlessly cluttering our code:

    http://codepad.org/YtkJflcV

In particular, they're making it more difficult for me to patch
#38466. Note that Octave's in-place operators are meant to be pure
syntactic sugar, and they are supposed to behave exactly like their
expanded versions.

Any objection to completely removing all of the inplace logic from C++?

- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]