C++14: Replace ITK_OVERRIDE by override
find . -type f -exec sed -i "s/ITK_OVERRIDE/override/g" {} \;
Related to !130 (merged) !133 (merged)
Merge request reports
Activity
Why not using clang-tidy as proposed a long time ago https://wiki.orfeo-toolbox.org/index.php/Request_for_Comments-36:_Move_OTB_to_C%2B%2B14#Transform_OTB_code_with_clang-tidy
Reminder:
To run clang-tidy on a complete CMake project, on has to run CMake with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON in order to generate a JSON file which can be used by the run-clang-tidy script. Then, one can do:
run-clang-tidy-3.9.py -header-filter='.*' -checks='-*,modernize-use-auto,modernize-loop-convert,modernize-deprecated-headers,modernize-use-override,modernize-use-nullptr,modernize-use-bool-literals' -fix
Before running clang-tidy, it is useful to replace some ITK macros like ITK_NULLPTR and ITK_OVERRIDE by the standard keywords nullptr and override:
find ./ -type f -print0 | xargs -0 sed -i 's/ITK_OVERRIDE/override/g' find ./ -type f -print0 | xargs -0 sed -i 's/ITK_NULLPTR/nullptr/g'
After running clang-tidy, 2 small corrections have to be made:
find ./ -type f -print0 | xargs -0 sed -i 's/itkFactorylessNewMacro(auto)/itkFactorylessNewMacro(Self)/g'
find ./ -type f -print0 | xargs -0 sed -i 's/auto char/auto/g'The same comment applies to !130 (merged) and !133 (merged) (with the appropriate check https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-delete.html)
Edited by Jordi Ingladamentioned in commit 9bdec1f7
added refactoring label
changed milestone to %7.0.0