Skip to content

Default-member-initializers, default default-constructors in BinaryMathematicalMorphology#6556

Merged
hjmjohnson merged 2 commits into
InsightSoftwareConsortium:mainfrom
N-Dekker:Default-member-initializers-BinaryMathematicalMorphology
Jul 7, 2026
Merged

Default-member-initializers, default default-constructors in BinaryMathematicalMorphology#6556
hjmjohnson merged 2 commits into
InsightSoftwareConsortium:mainfrom
N-Dekker:Default-member-initializers-BinaryMathematicalMorphology

Conversation

@N-Dekker

@N-Dekker N-Dekker commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Style improvements BinaryMathematicalMorphology:

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.

@github-actions github-actions Bot added the area:Filtering Issues affecting the Filtering module label Jul 6, 2026

@hjmjohnson hjmjohnson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greptile review

N-Dekker added 2 commits July 7, 2026 11:54
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.
@N-Dekker N-Dekker force-pushed the Default-member-initializers-BinaryMathematicalMorphology branch from 98613fe to 8a822a5 Compare July 7, 2026 09:54
@N-Dekker

N-Dekker commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@greptile review

@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 😃

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

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 .greptile/rules.md and .greptile/config.json.

@N-Dekker

N-Dekker commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

In the meantime, I submitted a related PR to the C++ Core Guidelines:

@N-Dekker N-Dekker marked this pull request as ready for review July 7, 2026 13:07
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refactors default initialization in BinaryMathematicalMorphology filters. The main changes are:

  • Moves constant constructor initializers to default member initializers.
  • Defaults constructors that no longer need out-of-line definitions.
  • Keeps constructors with setup side effects for kernel analysis, output setup, and boundary-condition initialization.

Confidence Score: 5/5

Safe to merge with minimal risk.

The changes are mechanical C++ initialization refactors that preserve the previous defaults and constructor side effects.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • The build for ITKBinaryMathematicalMorphologyTestDriver completed successfully with exit code 0.
  • The test listing confirmed that 11 tests were selected by the requested regex.
  • The CTest run exited with code 8 due to missing input files in the ExternalData/Testing/Data/Input directory.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

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

@hjmjohnson hjmjohnson merged commit b2b98a2 into InsightSoftwareConsortium:main Jul 7, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Filtering Issues affecting the Filtering module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants