Default-member-initializers, default default-constructors in BinaryMathematicalMorphology#6556
Conversation
Moved initialization values of non-static data members from the member-initializer-lists of default-constructors to their default-member-initializers. Following C++ Core Guidelines, Jun 14, 2026, "Prefer default member initializers to member initializers in constructors for constant initializers", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c48-prefer-default-member-initializers-to-member-initializers-in-constructors-for-constant-initializers Will make Doxygen generated documentation more informative, as default member initializers appear in the class documentation.
Defaulted four empty default-constructor from BinaryMathematicalMorphology inside the definition of their classes. Will make Doxygen generated documentation more informative, as these constructors will be marked "default" in the class documentation.
98613fe to
8a822a5
Compare
@hjmjohnson Doesn't Greptile run automatically once the PR is marked ready? Anyway, we'll see! My force-push just fixed a few typo's in the commit messages and rebased onto main. When it has passed the CI again, I think I'll mark it ready 😃 |
|
Yes, Greptile triggers automatically when a PR is marked ready for review (or on pushes to open PRs, depending on config). Good call waiting for CI to go green first before marking it ready — that way the review and CI results land at the same time. Looking forward to reviewing it! Tip: You can customize Greptile's behavior for this repo with |
|
In the meantime, I submitted a related PR to the C++ Core Guidelines: |
|
| Filename | Overview |
|---|---|
| Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologicalClosingImageFilter.h | Defaults the constructor and preserves existing foreground and safe-border defaults as member initializers. |
| Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.h | Moves foreground and background default values into member declarations while retaining the custom constructor for kernel analysis. |
| Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryMorphologyImageFilter.hxx | Keeps constructor side effects intact and removes only initializer-list entries now covered in-class. |
| Modules/Filtering/BinaryMathematicalMorphology/include/itkBinaryPruningImageFilter.hxx | Leaves constructor output setup unchanged while removing the moved iteration initializer. |
| Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.h | Moves the object-value default into the protected member declaration. |
| Modules/Filtering/BinaryMathematicalMorphology/include/itkObjectMorphologyImageFilter.hxx | Keeps constructor setup for boundary condition and threading while removing equivalent default member initialization. |
Reviews (1): Last reviewed commit: "STYLE: Default empty default-constructor..." | Re-trigger Greptile
b2b98a2
into
InsightSoftwareConsortium:main
Style improvements BinaryMathematicalMorphology:
default-member-initializers. Following C++ Core Guidelines, Prefer default member initializers to member initializers in constructors for constant initializers
Will make Doxygen generated documentation more informative, as default-member-initializers appear in the class documentation, and defaulted constructors will be marked "default" in the class documentation.