InsightSoftwareConsortium / ITKSphinxExamples

Cookbook examples for the Insight Toolkit documented with Sphinx
https://examples.itk.org
Apache License 2.0
53 stars 65 forks source link

STYLE: Replace postfix by prefix increment in C++ `for` loops #381

Closed N-Dekker closed 2 years ago

N-Dekker commented 2 years ago

Applied to the src directory, at the GNU bash prompt:

find . -exec perl -pi -w -e 's/(\s+for \(.*;.*); (\w+)\+\+\)/$1; ++$2)/g;' {} \;

Follow-up to ITK pull request https://github.com/InsightSoftwareConsortium/ITK/pull/2505 commit https://github.com/InsightSoftwareConsortium/ITK/commit/878fa6f4356a428230b4a097f604347806376072 "STYLE: Replace postfix by prefix increment in for loops in Examples"

According to Herb Sutter, Andrei Alexandrescu - C++ Coding Standards: 101 Rules, Guidelines, and Best Practices: "Prefer the canonical form of ++ and --. Prefer calling the prefix forms"