See blocking bug for details.
modernize-use-equals-default rewrites special member functions whose behavior
matches the default, with "= default".
This:
* Greatly simplifies copy constructors, and copy assign operators because
the member variables don't need to be explicitly mentioned.
* In some cases allows classes that were previously non-aggregates or
non-trivial to become aggregates or trivial. Explicitly writing an empty
body for default constructor disqualifies it from being trivial.
Trivial classes and member functions can be better optimized by the
compiler and library (via type traits).
* Lets the defaulted functions and constructors to be constexpr if the
implicit version would have been.
* More clearly communicates intent, especially to distinguish member
functions that aren't customized from those that are.
See the cxx post for more details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8
Also see the blocking bug.
modernize-use-equals-default rewrites special member functions whose behavior
matches the default, with "= default".
Copied from https://www.chromium.org/developers/coding-style/cpp-dos-and-donts#TOC-Prefer-to-use-default :
What are the advantages of =default?
* Compiler-defined copy and move operations don't need maintenance every time members are added or removed.
* Compiler-provided special member functions can be "trivial" (if defaulted in the class), and can be better optimized by the compiler and library.
* Types with defaulted constructors can be aggregates (if defaulted in the class), and hence support aggregate initialization. User provided constructors disqualify a class from being an aggregate.
* Defaulted functions are constexpr if the implicit version would have been (and if defaulted in the class).
* Using =default consistently helps readers identify customized operations.
See the cxx post for more details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8
Also see the blocking bug.
Comment 1 by slangley@chromium.org
, Nov 24 2017