Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On 10/25/2011 04:04 AM, Kevin Hunter wrote:
At 9:48pm -0400 Mon, 24 Oct 2011, Kevin Hunter wrote:
At 7:24pm -0400 Mon, 24 Oct 2011, Fridrich Štrba wrote:
for (std::map<WPXString, FontStyle *, ltstr>::const_iterator iter =
mHash.begin();
- iter != mHash.end(); ++iter)
+ iter != mHash.end(); iter++)

Err, in terms of coding style, is a pre to post increment operator
merely a whitespace change? I seem to recall a message or two on the
subject but I'm having a difficult time tracking them down just now.
About 8 months ago, perhaps?

Kevin: open mouth, insert foot. I apologize. Just perusing commits,
should've kept going. I take it the pre to post is needed to "fix the
build".

This looks more like "fix the build" reverted more than was really necessary in this case.

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.

That said, you see both forms with more-or-less similar frequency in the wild.

-Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.