diff --git a/.clang-tidy b/.clang-tidy index ea79ea69b48a9967668072aef56f063c623268b0..62ac712d0f080d153000a9777bfb34a5e14b8fb3 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -110,15 +110,15 @@ Checks: ' -cppcoreguidelines-explicit-virtual-functions, -cppcoreguidelines-pro-type-const-cast, -cppcoreguidelines-pro-type-static-cast-downcast, --google-explicit-constructor, --google-readability-avoid-underscore-in-googletest-name, --google-runtime-references, --hicpp-explicit-conversions, --hicpp-member-init, --hicpp-noexcept-move, --llvm-qualified-auto, --misc-non-private-member-variables-in-classes, --misc-uniqueptr-reset-release, +google-explicit-constructor, +google-readability-avoid-underscore-in-googletest-name, +google-runtime-references, +hicpp-explicit-conversions, +hicpp-member-init, +hicpp-noexcept-move, +llvm-qualified-auto, +misc-non-private-member-variables-in-classes, +misc-uniqueptr-reset-release, modernize-avoid-bind, modernize-make-unique, modernize-pass-by-value, diff --git a/Base/Axis/IAxis.h b/Base/Axis/IAxis.h index 4ff1de216e1484f27e8b6b107e4cfa48f6eada3b..4aa0982e2c04f3921020037a03f639744b24f187 100644 --- a/Base/Axis/IAxis.h +++ b/Base/Axis/IAxis.h @@ -24,7 +24,7 @@ class IAxis { public: - IAxis(std::string name) : m_name(std::move(name)) {} + explicit IAxis(std::string name) : m_name(std::move(name)) {} IAxis(const IAxis&) = delete; virtual ~IAxis() {} diff --git a/Base/Axis/VariableBinAxis.h b/Base/Axis/VariableBinAxis.h index f8e1bddf2cb86c8b47bbdb70b46dd9bbfc620b38..7b018038b4678fd12a9aab130c849f8ec74abc3b 100644 --- a/Base/Axis/VariableBinAxis.h +++ b/Base/Axis/VariableBinAxis.h @@ -52,7 +52,7 @@ public: virtual void clip(double lower, double upper) override; protected: - VariableBinAxis(const std::string& name, size_t nbins = 0); + explicit VariableBinAxis(const std::string& name, size_t nbins = 0); void setBinBoundaries(const std::vector<double>& bin_boundaries); virtual void print(std::ostream& ostr) const override; diff --git a/Base/Element/IElement.h b/Base/Element/IElement.h index b8a02317b41c8f70885b4d86295bef5d676a27fc..527e97ea18a5a3676ff2d9995dbda683330dc836 100644 --- a/Base/Element/IElement.h +++ b/Base/Element/IElement.h @@ -29,7 +29,7 @@ class IElement { public: - IElement(PolMatrices polpair) : m_polpair(std::move(polpair)) {} + explicit IElement(PolMatrices polpair) : m_polpair(std::move(polpair)) {} protected: const PolMatrices m_polpair; diff --git a/Base/Types/SafePointerVector.h b/Base/Types/SafePointerVector.h index 880564f75669335ba8236eb45c4a57c3460c537d..728a880ce603566c0e48de068f91addeafc00fc5 100644 --- a/Base/Types/SafePointerVector.h +++ b/Base/Types/SafePointerVector.h @@ -33,11 +33,11 @@ public: using const_iterator = typename std::vector<T *>::const_iterator; SafePointerVector() {} SafePointerVector(const SafePointerVector& other); - SafePointerVector(SafePointerVector&& other); + SafePointerVector(SafePointerVector&& other) noexcept ; ~SafePointerVector() { clear(); } SafePointerVector& operator=(const SafePointerVector& right); - SafePointerVector& operator=(SafePointerVector&& right); + SafePointerVector& operator=(SafePointerVector&& right) noexcept ; size_t size() const { return m_pointers.size(); } bool empty() const { return m_pointers.empty(); } void push_back(T* pointer) { m_pointers.push_back(pointer); } @@ -64,7 +64,7 @@ template <class T> SafePointerVector<T>::SafePointerVector(const SafePointerVect template <class T> SafePointerVector<T>::SafePointerVector(SafePointerVector<T>&& other) - : m_pointers(std::move(other.m_pointers)) + noexcept : m_pointers(std::move(other.m_pointers)) { } @@ -81,7 +81,7 @@ SafePointerVector<T>& SafePointerVector<T>::operator=(const SafePointerVector<T> template <class T> SafePointerVector<T>& SafePointerVector<T>::operator=(SafePointerVector<T>&& right) -{ + noexcept { clear(); m_pointers = std::move(right.m_pointers); right.m_pointers.clear(); diff --git a/Base/Vector/Transform3D.h b/Base/Vector/Transform3D.h index 022296750fef6083507f9f086fb9cffa8b7cbb83..234f4c4f15a832d424abf56b319361f382ba5bbc 100644 --- a/Base/Vector/Transform3D.h +++ b/Base/Vector/Transform3D.h @@ -31,7 +31,7 @@ public: #ifndef SWIG //! Constructor from matrix (no checks if this is an element of SO(3)!) - Transform3D(Eigen::Matrix3d matrix); + explicit Transform3D(Eigen::Matrix3d matrix); #endif //! Destructor diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index 324f4f76ba5ecd2013045c2cae1ef2e2ef448f8f..8eb952e28b25e820d36d600f08b8e833bb38c8f0 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -988,7 +988,7 @@ C++ includes: SafePointerVector.h %feature("docstring") SafePointerVector::SafePointerVector "SafePointerVector< T >::SafePointerVector(const SafePointerVector &other) "; -%feature("docstring") SafePointerVector::SafePointerVector "SafePointerVector< T >::SafePointerVector(SafePointerVector &&other) +%feature("docstring") SafePointerVector::SafePointerVector "SafePointerVector< T >::SafePointerVector(SafePointerVector &&other) noexcept "; %feature("docstring") SafePointerVector::~SafePointerVector "SafePointerVector< T >::~SafePointerVector()