STYLE: Use default member initialization#324
Conversation
Converts a default constructor’s member initializers into the new
default member initializers in C++11. Other member initializers that match the
default member initializer are removed. This can reduce repeated code or allow
use of ‘= default’.
VIM FIXUP: :%s/\({[^}][^}]*}\)\(\1\)*/\1/g
SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clang/ #My local BLD
cd /Users/johnsonhj/Dashboard/src/ITK-clang/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-default-member-init -header-filter=.* -fix
76397f6 to
a9a501e
Compare
N-Dekker
left a comment
There was a problem hiding this comment.
Very impressive :-) OK, it does "only converts member initializers for built-in types, enums, and pointers", but I think it's a great improvement. Thank you, Hans!
| m_Thickness( 1.0 ), | ||
| m_Normalize(false), | ||
| m_BrightCenter(false), | ||
|
|
There was a problem hiding this comment.
An unnecessary (?) empty line.
| m_IsInBoundsValid(false), | ||
| m_NeedToUseBoundaryCondition(false) | ||
| ::ConstNeighborhoodIterator() | ||
|
|
There was a problem hiding this comment.
Another unnecessary (?) empty line.
| m_ApertureAngleY( 0.0f ), | ||
| m_TopPlane( 0.0f ), | ||
| m_BottomPlane( 0.0f ), | ||
|
|
There was a problem hiding this comment.
Another unnecessary (?) empty line.
| m_Order(1), | ||
| m_Spacing(1.0) | ||
| ::GaussianDerivativeOperator() | ||
|
|
There was a problem hiding this comment.
Another unnecessary (?) empty line.
| m_Scale( 1.0 ), | ||
| m_Normalized( false ) | ||
| ::GaussianSpatialFunction() | ||
|
|
There was a problem hiding this comment.
Another unnecessary (?) empty line (etc. etc).
|
@N-Dekker The automated tools have this side effect. I'm slowly working on a separate patch to clean those up. It also identifies several places where constructors can now be set to "= default' in the .h file instead of showing up in the .hxx files. That work is something that I hope a new developer can work on. |
Converts a default constructor’s member initializers into the new
default member initializers in C++11. Other member initializers that match the
default member initializer are removed. This can reduce repeated code or allow
use of ‘= default’.
VIM FIXUP: :%s/({[^}][^}]})(\1)/\1/g
SRCDIR=/Users/johnsonhj/Dashboard/src/ITK #My local SRC
BLDDIR=/Users/johnsonhj/Dashboard/src/ITK-clang/ #My local BLD
cd /Users/johnsonhj/Dashboard/src/ITK-clang/
run-clang-tidy.py -extra-arg=-D__clang__ -checks=-,modernize-use-default-member-init -header-filter=. -fix