Skip to content

STYLE: Prefer c++11 'using' to 'typedef'#1047

Merged
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom
hjmjohnson:prefer-using-to-typedef
Jul 1, 2019
Merged

STYLE: Prefer c++11 'using' to 'typedef'#1047
dzenanz merged 2 commits intoInsightSoftwareConsortium:masterfrom
hjmjohnson:prefer-using-to-typedef

Conversation

@hjmjohnson
Copy link
Copy Markdown
Member

No description provided.

@hjmjohnson hjmjohnson requested review from dzenanz and thewtex June 30, 2019 02:56
Comment thread Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx Outdated
Comment thread Modules/Filtering/FastMarching/test/itkFastMarchingImageFilterBaseTest.cxx Outdated
Describe function overrides using the override
keyword from C++11.

SRCDIR=/localscratch/Users/johnsonhj/src/AZTEST/ITKEx-bld/ITK #My local SRC
BLDDIR=/localscratch/Users/johnsonhj/src/AZTEST/ITKEx-bld/ITK-clang9 #My local BLD

cd /localscratch/Users/johnsonhj/src/AZTEST/ITKEx-bld/ITK-clang9
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-override  -header-filter=.* -fix
Keep the naming style consistent with c++11
recommended style.
@hjmjohnson hjmjohnson force-pushed the prefer-using-to-typedef branch from c716ba9 to 4ab1b93 Compare June 30, 2019 18:24
@hjmjohnson hjmjohnson self-assigned this Jul 1, 2019
@hjmjohnson
Copy link
Copy Markdown
Member Author

@dzenanz Please merge if you approve.

Copy link
Copy Markdown
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

The amended version seems to be more comprehensive!

@dzenanz dzenanz merged commit f42f88b into InsightSoftwareConsortium:master Jul 1, 2019
@hjmjohnson hjmjohnson deleted the prefer-using-to-typedef branch October 23, 2019 13:27
N-Dekker added a commit to SuperElastix/elastix that referenced this pull request Jan 5, 2022
Ran LLVM 13.0.0 Clang-Tidy check `modernize-use-using`: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html

Did Notepad++ v8.1.9.3 Find in Files

    Find what:   typedef (\w+) [ ]*(\w+);
    Replace with:   using $2 = $1;
    [v] Match case
    (*) Regular expression

Following ITK "STYLE: Prefer c++11 'using' to 'typedef'":
- pull request InsightSoftwareConsortium/ITK#1628 commit InsightSoftwareConsortium/ITK@32f6f1e by Hans Johnson, 20 February 2020.
- pull request InsightSoftwareConsortium/ITK#1047 commit InsightSoftwareConsortium/ITK@f42f88b by Hans Johnson, Dženan Zukić, 1 July 2019

In accordance with C++ Core Guidelines, January 3, 2022: "Prefer `using` over `typedef` for defining aliases", https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rt-using
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