InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

STYLE: Remove `this->MakeOutput(0)` calls from constructors in Core #4654

Open N-Dekker opened 1 month ago

N-Dekker commented 1 month ago

In those cases, MakeOutput(0) just did OutputType::New() anyway. This commit avoids unnecessary casts and calls to virtual functions.

Following C++ Core Guidelines, February 15, 2024, "Don’t call virtual functions in constructors and destructors", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-ctor-virtual


Intended for after the release of ITK v5.4.0

N-Dekker commented 1 month ago

I think this pull request may also be merged now, as v5.4.0 has been tagged (https://github.com/InsightSoftwareConsortium/ITK/pull/4603#issuecomment-2120498131)

N-Dekker commented 1 week ago