-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
COMP: Add type aliases of ptrdiff_t and size_t to the itk
namespace
#4622
COMP: Add type aliases of ptrdiff_t and size_t to the itk
namespace
#4622
Conversation
Officially, we may not assume that `ptrdiff_t` and `size_t` are defined in the global namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good solution to being backward compatible.
@thewtex FYI, I think this pull request can be merged safely for ITK 5.4. On the other hand, it isn't very urgent to me, personally. It might become urgent, once compilers start to complain about using |
This looks like a low-risk addition, and merging it sooner rather than later is better in my opinion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@N-Dekker thanks for the patch 👍 This does seem to be low risk; however, it is also possible to cause issues since there may be naming conflicts. Since this is not addressing a known issue, it should be merged after v5.4.0.
@thewtex OK, no problem. Marked "draft"to avoid accidentally being merged before the release of v5.4.0. 👍 |
I think this pull request may also be merged now, as v5.4.0 has been tagged: #4603 (comment) |
Officially, we may not assume that
ptrdiff_t
andsize_t
are defined in the global namespace.Motivation: Both
ptrdiff_t
andsize_t
are already commonly being used inside theitk
namespace, without specifying theirstd
namespace:ITK/Modules/IO/ImageBase/include/itkConvertPixelBuffer.h
Line 64 in 487da6d
ITK/Modules/Video/IO/src/itkFileListVideoIO.cxx
Line 64 in 487da6d
It just compiles, so far! However, compilers may become more picky, as those types are not guaranteed to remain available in the global namespace.