mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add missing assertion in swap()
This commit is contained in:
@@ -404,6 +404,7 @@ template<typename Derived> class DenseBase
|
|||||||
void swap(const DenseBase<OtherDerived>& other,
|
void swap(const DenseBase<OtherDerived>& other,
|
||||||
int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
|
int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
|
||||||
{
|
{
|
||||||
|
eigen_assert(rows()==other.rows() && cols()==other.cols());
|
||||||
call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
|
call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,6 +415,7 @@ template<typename Derived> class DenseBase
|
|||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
void swap(PlainObjectBase<OtherDerived>& other)
|
void swap(PlainObjectBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
|
eigen_assert(rows()==other.rows() && cols()==other.cols());
|
||||||
call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
|
call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
|
||||||
}
|
}
|
||||||
#else // EIGEN_TEST_EVALUATORS
|
#else // EIGEN_TEST_EVALUATORS
|
||||||
|
|||||||
Reference in New Issue
Block a user