https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119323

--- Comment #10 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Robert Dubner from comment #9)
> This was an interesting exercise.

Good.

> cppcheck was a bit snide about using ++/-- prefix notation for iterators
> rather than the postfix notation, giving the argument that the prefix
> notation generates more efficient code.
> 
> That made an eyebrow go up.  I suppose that there still might be computers
> slow enough that when using a compiler stupid enough to not know about that
> particular optimization could result in code that runs "slower", where
> "slower" means using an atomic clock and an laser interferometer to detect
> the difference.  But I doubt it.

OTOH, it been standard practice for decades in C++ to prefer prefix to postfix.
IIRC something about needing to construct fewer temporary variables.
Scott Meyers has more detail.

There is never any shortage of slow computers. It is the fast ones we are
short of.

> Given that I believe the other issues in this PR have been addressed and
> since using my recipe results in no warnings, I am closing this out.

You did far more than I expected. Well done.

> David, thanks very much for your help getting me off the ground with
> cppcheck.

You are welcome. I may well check again in a month or so for any
new cppcheck warnings.

Reply via email to