STYLE: Use trailing return type instead of typename + dependent type#4026
Merged
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom Apr 25, 2023
Merged
Conversation
2 tasks
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 |
N-Dekker
approved these changes
Apr 24, 2023
N-Dekker
reviewed
Apr 24, 2023
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
b982fc7 to
afe7257
Compare
Member
Author
|
Also did a rebase along with the amend. |
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""
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.
This is a follow-up to b18668b and b37ac53.
It reapplied regex replace from b18668b.
PR Checklist