Skip to content

Comments

Remove typename and itk::, when using Iterator type in itk namespace#5818

Open
N-Dekker wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker:STYLE-Using-Iterator
Open

Remove typename and itk::, when using Iterator type in itk namespace#5818
N-Dekker wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
N-Dekker:STYLE-Using-Iterator

Conversation

@N-Dekker
Copy link
Contributor

@N-Dekker N-Dekker commented Feb 21, 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"

@github-actions github-actions bot added area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module type:Style Style changes: no logic impact (indentation, comments, naming) labels Feb 21, 2026
@N-Dekker N-Dekker changed the title STYLE: Remove itk:: when using Iterator type in itk namespace Remove typename and itk::, when using Iterator type in itk namespace Feb 21, 2026
@N-Dekker N-Dekker marked this pull request as ready for review February 21, 2026 11:14
@N-Dekker N-Dekker marked this pull request as draft February 22, 2026 12:13
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"
@N-Dekker N-Dekker force-pushed the STYLE-Using-Iterator branch from 25aa3a4 to 36df565 Compare February 22, 2026 12:36
@github-actions github-actions bot removed the type:Style Style changes: no logic impact (indentation, comments, naming) label Feb 22, 2026
@N-Dekker N-Dekker marked this pull request as ready for review February 22, 2026 12:37
{
// Create an iterator that will walk the input image
using IRIType = typename itk::ImageRegionConstIterator<TImage>;
using IRIType = ImageRegionConstIterator<TImage>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

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!

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 area:Filtering Issues affecting the Filtering module area:Registration Issues affecting the Registration module area:Segmentation Issues affecting the Segmentation module area:Video Issues affecting the Video module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants