38 lines · plain
1.. title:: clang-tidy - modernize-use-equals-default2 3modernize-use-equals-default4============================5 6This check replaces default bodies of special member functions with ``=7default;``. The explicitly defaulted function declarations enable more8opportunities in optimization, because the compiler might treat explicitly9defaulted functions as trivial.10 11.. code-block:: c++12 13 struct A {14 A() {}15 ~A();16 };17 A::~A() {}18 19 // becomes20 21 struct A {22 A() = default;23 ~A();24 };25 A::~A() = default;26 27.. note::28 Move-constructor and move-assignment operator are not supported yet.29 30Options31-------32 33.. option:: IgnoreMacros34 35 If set to `true`, the check will not give warnings inside macros and will36 ignore special members with bodies contain macros or preprocessor directives.37 Default is `true`.38