STYLE: Remove std:: prefix from types that work without it#3250
STYLE: Remove std:: prefix from types that work without it#3250hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom Leengit:remove_std_from_itk_types
std:: prefix from types that work without it#3250Conversation
This is accomplished with
cd git/ITK
find * -type f |
egrep '\.(c|cc|cxx|cpp|h|hh|hxx|hpp)$' |
fgrep -v ThirdParty |
fgrep -v itkIntTypes.h |
xargs sed -i -r -e \
's/std::((size|ptrdiff|max_align|u?int(_fast|_least|max|ptr)?[0-9]*)_t)/\1/g'
|
@Leengit C++ doesn't specify whether or not the |
Wherever they come from doesn't matter to me. Folks have been using the short form predominantly, it works, and I am bringing the minority of cases into the fold. |
The majority isn't always right! It does help if we could specify why and when the There is no "max_align..." alias in "itkIntTypes.h", should it still be added? |
I understood this is true from https://en.cppreference.com/w/cpp/types/integer. |
|
Good point about Some of these types are in the global namespace and some are in the |
What do you propose? |
In general: if there is a significant minority of the code doing it otherwise, double-check if the majority of the code really does the right thing, before adjusting the minority to the majority. Specifically in this case, it appears reasonable to remove |
The latest draft of the C++ Standard section [headers] says:
HTH, Niels |
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits, authored by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits, authored by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits, authored by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits, authored by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits, authored by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Added coding style guidelines for specifying built-in integer types and integer types from the C library. Following recent ITK commits, authored by Lee Newberg: pull request InsightSoftwareConsortium/ITK#3365 commit InsightSoftwareConsortium/ITK@8c2c654 commit InsightSoftwareConsortium/ITK@e03a941 "STYLE: Drop `signed` and `int` from some types" pull request InsightSoftwareConsortium/ITK#3139 commit InsightSoftwareConsortium/ITK@a812aa3 "STYLE: Change unsigned to unsigned int." pull request InsightSoftwareConsortium/ITK#3250 commit InsightSoftwareConsortium/ITK@c173dfd "STYLE: Remove `std::` prefix from types that work without it"
Follow-up to pull request InsightSoftwareConsortium#3250 commit c173dfd "STYLE: Remove `std::` prefix from types that work without it" Lee Newberg, March 6, 2022.
This is accomplished with
Closes #3248.
PR Checklist