[Libreoffice] [PATCH] improve style according to cppcheck

Takeshi Abe tabe at fixedpoint.jp
Sat Nov 27 10:36:35 PST 2010


Hi Christian,

On Sat, 27 Nov 2010 19:09:36 +0100, Christian Lohmaier <lohmaier+libreoffice at googlemail.com> wrote:
> I'm curious: Why does cppcheck "complain" about "for.... i++" and
> suggests/demands pre-increment instead (for ... ++i)?
> 
> Is there any noticable difference?
Yes, see:
http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.14
http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.15
IIRC Scott Meyers' "More Effective C++" also elaborates on it.

Corollary: we should prefer ++C to C++ to call the language :)

Cheers,
-- Takeshi Abe


More information about the LibreOffice mailing list