[Libreoffice] [Libreoffice-commits] .: writerperfect/source
Terrence Enger
tenger at iseries-guru.com
Thu Oct 27 05:54:45 PDT 2011
On Tue, 2011-10-25 at 09:16 +0200, Stephan Bergmann wrote:
>
> In general, and if the expression's value is not used, prefix
> increment/decrement is preferable to postfix, as the former conceptually
> avoids creation of a temporary that makes the old, unmodified value
> available as the expression's value.
Just to be picky, if my memory of C++ serves, ...
(*) For built-in types, it is true that prefix and postfix
increment/decrement have the same effect on the variable.
(*) For STL iterators, I guess that the same statement is true. At
least, I think that a violation of the symmetry would have
provoked my "Oh, eeeuuuw!" reflex so strongly that I would
remember it. <grin />
(*) For class types in general, the prefix and postfix operators can
be completely different. In my opinion, it is evil to do this;
but the language allows it.
Terry.
>
> That said, you see both forms with more-or-less similar frequency in the
> wild.
>
> -Stephan
More information about the LibreOffice
mailing list