Skip to content

STYLE: Use trailing return type instead of typename + dependent type#4026

Merged
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom
dzenanz:vs2017trailingReturnType
Apr 25, 2023
Merged

STYLE: Use trailing return type instead of typename + dependent type#4026
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom
dzenanz:vs2017trailingReturnType

Conversation

@dzenanz
Copy link
Copy Markdown
Member

@dzenanz dzenanz commented Apr 24, 2023

This is a follow-up to b18668b and b37ac53.

It reapplied regex replace from b18668b.

PR Checklist

@github-actions github-actions bot added area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module type:Style Style changes: no logic impact (indentation, comments, naming) area:Numerics Issues affecting the Numerics module labels Apr 24, 2023
@N-Dekker
Copy link
Copy Markdown
Contributor

Thanks @dzenanz Still don't know why I overlooked these when I originally ran the regex! Sorry! 🤷

The regex certainly did overlook lines of code that started with inline. Can you please check if these are now also included? I mean:

Find what: ^inline typename (\w+<.+>::)(.+)\r\n\1(.+)\r\n{\r\n

Comment thread Modules/Core/Transform/include/itkScaleTransform.hxx Outdated
dzenanz added 2 commits April 24, 2023 11:11
This is a follow-up to b18668b
and b37ac53.

It reapplied regex replace from b18668b.
Notepad++ RegEx replace

Find what: ^inline typename (\w+<.+>::)(.+)\r\n\1(.+)\r\n{\r\n
Replace with: inline auto\r\n$1$3 -> $2\r\n{\r\n
@dzenanz dzenanz force-pushed the vs2017trailingReturnType branch from b982fc7 to afe7257 Compare April 24, 2023 15:13
@dzenanz
Copy link
Copy Markdown
Member Author

dzenanz commented Apr 24, 2023

Also did a rebase along with the amend.

@dzenanz dzenanz marked this pull request as ready for review April 25, 2023 14:11
@dzenanz dzenanz merged commit f048a5b into InsightSoftwareConsortium:master Apr 25, 2023
@dzenanz dzenanz deleted the vs2017trailingReturnType branch April 25, 2023 16:16
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Apr 28, 2023
Did Notepad++ v8.4.8, Find in Files (Regular expression enabled):

    Find what: ^typename (\w+<.+>::)(.+)\r\n\1(.+)\r\n{\r\n
    Replace with: auto\r\n$1$3 -> $2\r\n{\r\n

    Find what: ^inline typename (\w+<.+>::)(.+)\r\n\1(.+)\r\n{\r\n
    Replace with: inline auto\r\n$1$3 -> $2\r\n{\r\n

Specifically for "itk*.h" files

In accordance with ITKSoftwareGuide pull request InsightSoftwareConsortium/ITKSoftwareGuide#162
commit InsightSoftwareConsortium/ITKSoftwareGuide@c64b23b
"ENH: Add "Trailing Return Types" section"

Follow-up to pull request InsightSoftwareConsortium#4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Apr 28, 2023
Did search for return types of template member functions matching the regular
expression `^inline typename (\w+<.+>::)` and manually replaced them with
trailing return types, when possible.

Follow-up to pull request InsightSoftwareConsortium#4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
N-Dekker added a commit to N-Dekker/ITK that referenced this pull request Apr 28, 2023
Replaced `typename` with trailing return types in multi-line template member
function declarations.

Did so by Notepad++ v8.4.8, Find in Files:

    Find what: ^typename (\w+<.+>::)(.+)\r\n\1((.+\r\n)+?){\r\n
    Replace with: auto\r\n$1$3 -> $2\r\n{\r\n
    Filters: itk*.hxx;itk*.h;itk*.cxx
    [v] Match case
    (*) Regular expression

Manually fixed two `CopyDisplacementField` member functions, which still needed
a `typename` keyword anyway.

In accordance with ITKSoftwareGuide pull request InsightSoftwareConsortium/ITKSoftwareGuide#162
commit InsightSoftwareConsortium/ITKSoftwareGuide@c64b23b
"ENH: Add "Trailing Return Types" section"

Follow-up to pull request InsightSoftwareConsortium#4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
hjmjohnson pushed a commit that referenced this pull request Apr 30, 2023
Did Notepad++ v8.4.8, Find in Files (Regular expression enabled):

    Find what: ^typename (\w+<.+>::)(.+)\r\n\1(.+)\r\n{\r\n
    Replace with: auto\r\n$1$3 -> $2\r\n{\r\n

    Find what: ^inline typename (\w+<.+>::)(.+)\r\n\1(.+)\r\n{\r\n
    Replace with: inline auto\r\n$1$3 -> $2\r\n{\r\n

Specifically for "itk*.h" files

In accordance with ITKSoftwareGuide pull request InsightSoftwareConsortium/ITKSoftwareGuide#162
commit InsightSoftwareConsortium/ITKSoftwareGuide@c64b23b
"ENH: Add "Trailing Return Types" section"

Follow-up to pull request #4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
hjmjohnson pushed a commit that referenced this pull request Apr 30, 2023
Did search for return types of template member functions matching the regular
expression `^inline typename (\w+<.+>::)` and manually replaced them with
trailing return types, when possible.

Follow-up to pull request #4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
hjmjohnson pushed a commit that referenced this pull request Apr 30, 2023
Replaced `typename` with trailing return types in multi-line template member
function declarations.

Did so by Notepad++ v8.4.8, Find in Files:

    Find what: ^typename (\w+<.+>::)(.+)\r\n\1((.+\r\n)+?){\r\n
    Replace with: auto\r\n$1$3 -> $2\r\n{\r\n
    Filters: itk*.hxx;itk*.h;itk*.cxx
    [v] Match case
    (*) Regular expression

Manually fixed two `CopyDisplacementField` member functions, which still needed
a `typename` keyword anyway.

In accordance with ITKSoftwareGuide pull request InsightSoftwareConsortium/ITKSoftwareGuide#162
commit InsightSoftwareConsortium/ITKSoftwareGuide@c64b23b
"ENH: Add "Trailing Return Types" section"

Follow-up to pull request #4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
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:Numerics Issues affecting the Numerics module type:Style Style changes: no logic impact (indentation, comments, naming)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants