mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
backport: the first fix was the good one
This commit is contained in:
parent
3590911de2
commit
aaf1826384
@ -539,12 +539,13 @@ class Matrix
|
||||
INVALID_MATRIX_TEMPLATE_PARAMETERS)
|
||||
}
|
||||
|
||||
template<typename MatrixType, typename OtherDerived, bool IsSameType>
|
||||
template<typename MatrixType, typename OtherDerived, bool IsSameType, bool IsDynamicSize>
|
||||
friend struct ei_matrix_swap_impl;
|
||||
};
|
||||
|
||||
template<typename MatrixType, typename OtherDerived,
|
||||
bool IsSameType = ei_is_same_type<MatrixType, OtherDerived>::ret>
|
||||
bool IsSameType = ei_is_same_type<MatrixType, OtherDerived>::ret,
|
||||
bool IsDynamicSize = MatrixType::SizeAtCompileTime==Dynamic>
|
||||
struct ei_matrix_swap_impl
|
||||
{
|
||||
static inline void run(MatrixType& matrix, MatrixBase<OtherDerived>& other)
|
||||
@ -554,11 +555,10 @@ struct ei_matrix_swap_impl
|
||||
};
|
||||
|
||||
template<typename MatrixType, typename OtherDerived>
|
||||
struct ei_matrix_swap_impl<MatrixType, OtherDerived, true>
|
||||
struct ei_matrix_swap_impl<MatrixType, OtherDerived, true, true>
|
||||
{
|
||||
static inline void run(MatrixType& matrix, MatrixBase<OtherDerived>& other)
|
||||
{
|
||||
ei_assert(matrix.rows() == other.rows() && matrix.cols() == other.cols());
|
||||
matrix.m_storage.swap(other.derived().m_storage);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user