diff --git a/src/OpenMesh/Core/Geometry/Vector11T.hh b/src/OpenMesh/Core/Geometry/Vector11T.hh index eefac1fb..74bd21a0 100644 --- a/src/OpenMesh/Core/Geometry/Vector11T.hh +++ b/src/OpenMesh/Core/Geometry/Vector11T.hh @@ -627,6 +627,11 @@ class VectorT { _rhs.values_.begin(), _rhs.values_.end()); } + /// swap with another vector + void swap(VectorT& _other) noexcept(noexcept(std::swap(values_, _other.values_))) { + std::swap(values_, _other.values_); + } + //------------------------------------------------------------ component iterators /// \name Component iterators @@ -694,7 +699,6 @@ Scalar dot(const VectorT& _v1, const VectorT& _v2) { return (_v1 | _v2); } - /// \relates OpenMesh::VectorT /// symmetric version of the cross product template @@ -704,6 +708,14 @@ cross(const VectorT& _v1, const VectorT& _v2) -> return (_v1 % _v2); } +/// \relates OpenMesh::VectorT +/// non-member swap +template +void swap(VectorT& _v1, VectorT& _v2) +noexcept(noexcept(_v1.swap(_v2))) +{ + _v1.swap(_v2); +} //== TYPEDEFS =================================================================