Skip to content

Commit

Permalink
STYLE: Prefer = default to explicitly trivial implementations
Browse files Browse the repository at this point in the history
This check replaces default bodies of special member functions with
= default;. The explicitly defaulted function declarations enable more
opportunities in optimization, because the compiler might treat
explicitly defaulted functions as trivial.

Additionally, the C++11 use of = default more clearly expreses the
intent for the special member functions.

Following the change in ITK, e.g.:
InsightSoftwareConsortium/ITK@5142ed7
  • Loading branch information
jhlegarreta committed Dec 22, 2021
1 parent 4d22d73 commit 0ef6f6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Developer/ImageSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class ImageSource : public ProcessObject
itkTypeMacro(ImageSource, ProcessObject);

protected:
ImageSource() {}
~ImageSource() {}
ImageSource() = default;
~ImageSource() = default;

/** Does the real work. */
virtual void
Expand Down

0 comments on commit 0ef6f6b

Please sign in to comment.