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.
  • Loading branch information
hjmjohnson authored and dzenanz committed Feb 26, 2020
1 parent 696adbb commit 1ee4d00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/itkFDFImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,9 @@ FDFImageIO::Read(void * buffer)
}


FDFImageIO::FDFImageIO() {}
FDFImageIO::FDFImageIO() = default;

FDFImageIO::~FDFImageIO() {}
FDFImageIO::~FDFImageIO() = default;

void
FDFImageIO::PrintSelf(std::ostream & os, Indent indent) const
Expand Down
2 changes: 1 addition & 1 deletion src/itkFDFImageIOFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FDFImageIOFactory::FDFImageIOFactory()
"itkImageIOBase", "itkFDFImageIO", "FDF Image IO", true, CreateObjectFunction<FDFImageIO>::New());
}

FDFImageIOFactory::~FDFImageIOFactory() {}
FDFImageIOFactory::~FDFImageIOFactory() = default;

const char *
FDFImageIOFactory::GetITKSourceVersion() const
Expand Down

0 comments on commit 1ee4d00

Please sign in to comment.