Skip to content

Commit

Permalink
Merge pull request #5066 from hjmjohnson/performance-noexcept-swap
Browse files Browse the repository at this point in the history
STYLE: performance-noexcept-swap clang-tidy
  • Loading branch information
thewtex authored Dec 14, 2024
2 parents 8c54399 + 7bceae7 commit 526fe30
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkCovariantVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ CrossProduct(CovariantVector<int, 3>, const Vector<int, 3> &, const Vector<int,

template <typename T, unsigned int VVectorDimension>
inline void
swap(CovariantVector<T, VVectorDimension> & a, CovariantVector<T, VVectorDimension> & b)
swap(CovariantVector<T, VVectorDimension> & a, CovariantVector<T, VVectorDimension> & b) noexcept
{
a.swap(b);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkDiffusionTensor3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class ITK_TEMPLATE_EXPORT DiffusionTensor3D : public SymmetricSecondRankTensor<T

template <typename T>
inline void
swap(DiffusionTensor3D<T> & a, DiffusionTensor3D<T> & b)
swap(DiffusionTensor3D<T> & a, DiffusionTensor3D<T> & b) noexcept
{
a.swap(b);
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkFixedArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class ITK_TEMPLATE_EXPORT FixedArray
Fill(const ValueType &);

void
swap(FixedArray & other)
swap(FixedArray & other) noexcept
{
std::swap(m_InternalArray, other.m_InternalArray);
}
Expand All @@ -468,7 +468,7 @@ operator<<(std::ostream & os, const FixedArray<TValue, VLength> & arr);

template <typename TValue, unsigned int VLength>
inline void
swap(FixedArray<TValue, VLength> & a, FixedArray<TValue, VLength> & b)
swap(FixedArray<TValue, VLength> & a, FixedArray<TValue, VLength> & b) noexcept
{
a.swap(b);
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkIndex.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ struct ITK_TEMPLATE_EXPORT Index final
}

void
swap(Index & other)
swap(Index & other) noexcept
{
std::swap(m_InternalArray, other.m_InternalArray);
}
Expand Down Expand Up @@ -585,7 +585,7 @@ operator>=(const Index<VDimension> & one, const Index<VDimension> & two)
// Specialized algorithms [6.2.2.2].
template <unsigned int VDimension>
inline void
swap(Index<VDimension> & one, Index<VDimension> & two)
swap(Index<VDimension> & one, Index<VDimension> & two) noexcept
{
std::swap(one.m_InternalArray, two.m_InternalArray);
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class ITK_TEMPLATE_EXPORT Matrix
}

void
swap(Self & other)
swap(Self & other) noexcept
{
// allow for augment dependent look up
using std::swap;
Expand Down Expand Up @@ -420,7 +420,7 @@ operator<<(std::ostream & os, const Matrix<T, VRows, VColumns> & v)

template <typename T, unsigned int VRows, unsigned int VColumns>
inline void
swap(const Matrix<T, VRows, VColumns> & a, const Matrix<T, VRows, VColumns> & b)
swap(const Matrix<T, VRows, VColumns> & a, const Matrix<T, VRows, VColumns> & b) noexcept
{
a.swap(b);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkMetaDataDictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ITKCommon_EXPORT MetaDataDictionary
};

inline void
swap(MetaDataDictionary & a, MetaDataDictionary & b)
swap(MetaDataDictionary & a, MetaDataDictionary & b) noexcept
{
a.Swap(b);
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkOffset.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ struct ITK_TEMPLATE_EXPORT Offset final
}

void
swap(Offset & other)
swap(Offset & other) noexcept
{
std::swap(m_InternalArray, other.m_InternalArray);
}
Expand Down Expand Up @@ -525,7 +525,7 @@ operator>=(const Offset<VDimension> & one, const Offset<VDimension> & two)
// Specialized algorithms [6.2.2.2].
template <unsigned int VDimension>
inline void
swap(Offset<VDimension> & one, Offset<VDimension> & two)
swap(Offset<VDimension> & one, Offset<VDimension> & two) noexcept
{
std::swap(one.m_InternalArray, two.m_InternalArray);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class ITK_TEMPLATE_EXPORT BarycentricCombination

template <typename TCoordinate, unsigned int VPointDimension>
inline void
swap(Point<TCoordinate, VPointDimension> & a, Point<TCoordinate, VPointDimension> & b)
swap(Point<TCoordinate, VPointDimension> & a, Point<TCoordinate, VPointDimension> & b) noexcept
{
a.swap(b);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkRGBAPixel.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ operator>>(std::istream & is, RGBAPixel<TComponent> & c);

template <typename T>
inline void
swap(RGBAPixel<T> & a, RGBAPixel<T> & b)
swap(RGBAPixel<T> & a, RGBAPixel<T> & b) noexcept
{
a.swap(b);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkRGBPixel.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ operator>>(std::istream & is, RGBPixel<TComponent> & c);

template <typename T>
inline void
swap(RGBPixel<T> & a, RGBPixel<T> & b)
swap(RGBPixel<T> & a, RGBPixel<T> & b) noexcept
{
a.swap(b);
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/Core/Common/include/itkSize.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ struct ITK_TEMPLATE_EXPORT Size final
}

void
swap(Size & other)
swap(Size & other) noexcept
{
std::swap(m_InternalArray, other.m_InternalArray);
}
Expand Down Expand Up @@ -499,7 +499,7 @@ operator>=(const Size<VDimension> & one, const Size<VDimension> & two)
// Specialized algorithms [6.2.2.2].
template <unsigned int VDimension>
inline void
swap(Size<VDimension> & one, Size<VDimension> & two)
swap(Size<VDimension> & one, Size<VDimension> & two) noexcept
{
std::swap(one.m_InternalArray, two.m_InternalArray);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkSymmetricSecondRankTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ operator>>(InputStreamType & is, SymmetricSecondRankTensor<TComponent, VDimensio

template <typename T>
inline void
swap(SymmetricSecondRankTensor<T> & a, SymmetricSecondRankTensor<T> & b)
swap(SymmetricSecondRankTensor<T> & a, SymmetricSecondRankTensor<T> & b) noexcept
{
a.swap(b);
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ ITKCommon_EXPORT Vector<int, 3>

template <typename T, unsigned int VVectorDimension>
inline void
swap(Vector<T, VVectorDimension> & a, Vector<T, VVectorDimension> & b)
swap(Vector<T, VVectorDimension> & a, Vector<T, VVectorDimension> & b) noexcept
{
a.swap(b);
}
Expand Down

0 comments on commit 526fe30

Please sign in to comment.