Skip to content

Conversation

blowekamp
Copy link
Member

Move meta programming details from unnamed namespace to separate file and header.

PR Checklist

  • No API changes were made (or the changes have been approved)
  • No major design changes were made (or the changes have been approved)
  • Added test (or behavior not changed)
  • Updated API documentation (or API not changed)
  • Added license to new files (if any)
  • Added Python wrapping to new files (if any) as described in ITK Software Guide Section 9.5
  • Added ITK examples for all new major features (if any)

Refer to the ITK Software Guide for
further development details if necessary.

Move meta programming details from unnamed namespace to separate file
and header.
@blowekamp blowekamp requested review from N-Dekker and dzenanz August 26, 2024 13:55
@github-actions github-actions bot added area:Core Issues affecting the Core module type:Style Style changes: no logic impact (indentation, comments, naming) labels Aug 26, 2024
Copy link
Contributor

@N-Dekker N-Dekker left a comment

Choose a reason for hiding this comment

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

Thanks @blowekamp I believe that the removal of this unnamed namespace from the hxx file is necessary because of the "one definition rule": multiple cxx files may share that same (one) definition of itk::MetaDataObject, whereas an unnamed namespace is different for each cxx file. But I did not ask the guru's 😸

Instead of moving the details to a different .h file, it would also be OK to me to have them in itkMetaDataObject.h or itkMetaDataObject.hxx (as long as they are in the "details" namespace), but your current PR is also fine to me. 👍

@blowekamp
Copy link
Member Author

Thanks @blowekamp I believe that the removal of this unnamed namespace from the hxx file is necessary because of the "one definition rule": multiple cxx files may share that same (one) definition of itk::MetaDataObject, whereas an unnamed namespace is different for each cxx file. But I did not ask the guru's 😸

Many complications to make this a clear issue template classes, unnamed namespace or local linkage, and only used as constexpr so the symbols may not really exist in the compilation unit.

Instead of moving the details to a different .h file, it would also be OK to me to have them in itkMetaDataObject.h or itkMetaDataObject.hxx (as long as they are in the "details" namespace), but your current PR is also fine to me. 👍

I may have miss understood what you suggested in parts of #4814. But it's already done, and I followed the model of itkMathDetail.h, and others. We are not too consistent with how these detail name spaces are defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module type:Style Style changes: no logic impact (indentation, comments, naming)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants