Remove typename and itk::, when using Iterator type in itk namespace#5818
Open
N-Dekker wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
Open
Remove typename and itk::, when using Iterator type in itk namespace#5818N-Dekker wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
typename and itk::, when using Iterator type in itk namespace#5818N-Dekker wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
Conversation
itk:: when using Iterator type in itk namespacetypename and itk::, when using Iterator type in itk namespace
dzenanz
approved these changes
Feb 21, 2026
Follow-up to pull request InsightSoftwareConsortium#5804 commit ad0eaca "STYLE: Remove redundant `typename` in type aliases", Hans Johnson, 15 Feb 2026
Using Notepad++, Replace in Files, doing
Find what: itk::(Image\w+Iterator)
Replace with: $1
Filters: itk*.hxx
[v] Match case
(*) Regular expression
Manually excluded "itkNeighborhoodIteratorTestCommon.hxx"
25aa3a4 to
36df565
Compare
N-Dekker
commented
Feb 22, 2026
| { | ||
| // Create an iterator that will walk the input image | ||
| using IRIType = typename itk::ImageRegionConstIterator<TImage>; | ||
| using IRIType = ImageRegionConstIterator<TImage>; |
Contributor
Author
There was a problem hiding this comment.
FYI, my force-push has just reverted the two commits. It appears preferable to remove the redundant typename keywords before removing the redundant itk:: qualifiers! When you remove the redundant itk:: qualifiers, the redundant typename keywords might cause compile errors! For example (https://godbolt.org/z/8Y4xbjefr):
// GCC 15.2 error: expected nested-name-specifier [-Wtemplate-body]
// Clang 21.1.0 error: expected a qualified name after 'typename'
using IRIType = typename ImageRegionConstIterator<TImage>;
So the redundant typename keywords must be removed first!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manually excluded "itkNeighborhoodIteratorTestCommon.hxx"
typenamefromImageRegionConstIterator<TImage>;following pull request STYLE: Remove redundanttypenamein type aliases #5804 by Hans (@hjmjohnson)