Skip to content

STYLE: Use auto for declaration of variables initialized by New()#165

Merged
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:Use-auto-for-variables-initialized-by-New
Oct 25, 2021
Merged

STYLE: Use auto for declaration of variables initialized by New()#165
hjmjohnson merged 1 commit intoInsightSoftwareConsortium:masterfrom
N-Dekker:Use-auto-for-variables-initialized-by-New

Conversation

@N-Dekker
Copy link
Copy Markdown
Contributor

Replaced initializations of the form T::Pointer var = T::New()
with auto var = T::New(), in accordance with ITK Coding Style section
"The auto Keyword", at
https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/v5.2.1/SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex#L1507-L1511

Using Notepad++ v8.1.4, Find in Files (Regular expression):

Find what: (\w+)::Pointer[ ]+(\w+) = \1::New\(\);
Replace with: auto $2 = $1::New\(\);

Corresponding ITK pull request: InsightSoftwareConsortium/ITK#2826

Replaced initializations of the form `T::Pointer var = T::New()`
with `auto var = T::New()`, in accordance with ITK Coding Style section
"The auto Keyword", at
https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/v5.2.1/SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex#L1507-L1511

Using Notepad++ v8.1.4, Find in Files (Regular expression):

    Find what: (\w+)::Pointer[ ]+(\w+) = \1::New\(\);
    Replace with: auto $2 = $1::New\(\);

Corresponding ITK pull request: InsightSoftwareConsortium/ITK#2826
@hjmjohnson hjmjohnson merged commit d7f79dc into InsightSoftwareConsortium:master Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants