mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
clarify the situation with EI_INHERIT_ASSIGNMENT_OPERATORS
This commit is contained in:
parent
884a718b0a
commit
d6f26dc8eb
@ -51,7 +51,7 @@ template<typename MatrixType> class Conjugate
|
||||
|
||||
Scalar _read(int row, int col) const
|
||||
{
|
||||
return Conj(m_matrix.read(row, col));
|
||||
return NumTraits<Scalar>::conj(m_matrix.read(row, col));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -47,6 +47,7 @@ template<typename Lhs, typename Rhs> class Difference
|
||||
Difference(const Difference& other)
|
||||
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Difference)
|
||||
|
||||
private:
|
||||
|
@ -42,6 +42,9 @@ template<typename MatrixType> class Identity
|
||||
assert(RowsAtCompileTime == ColsAtCompileTime);
|
||||
}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Identity)
|
||||
|
||||
private:
|
||||
Identity& _ref() { return *this; }
|
||||
const Identity& _ref() const { return *this; }
|
||||
|
@ -42,6 +42,7 @@ template<typename MatrixType> class Opposite
|
||||
Opposite(const Opposite& other)
|
||||
: m_matrix(other.m_matrix) {}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Opposite)
|
||||
|
||||
private:
|
||||
|
@ -82,6 +82,7 @@ template<typename Lhs, typename Rhs> class Product
|
||||
Product(const Product& other)
|
||||
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Product)
|
||||
|
||||
private:
|
||||
|
@ -40,6 +40,9 @@ template<typename MatrixType> class Random
|
||||
{
|
||||
assert(rows > 0 && cols > 0);
|
||||
}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Random)
|
||||
|
||||
private:
|
||||
const Random& _ref() const { return *this; }
|
||||
|
@ -43,6 +43,7 @@ template<typename MatrixType> class ScalarMultiple
|
||||
ScalarMultiple(const ScalarMultiple& other)
|
||||
: m_matrix(other.m_matrix), m_scalar(other.m_scalar) {}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(ScalarMultiple)
|
||||
|
||||
private:
|
||||
|
@ -47,6 +47,7 @@ template<typename Lhs, typename Rhs> class Sum
|
||||
Sum(const Sum& other)
|
||||
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Sum)
|
||||
|
||||
private:
|
||||
|
@ -41,6 +41,9 @@ template<typename MatrixType> class Zero
|
||||
assert(rows > 0 && cols > 0);
|
||||
}
|
||||
|
||||
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||
EI_INHERIT_ASSIGNMENT_OPERATORS(Zero)
|
||||
|
||||
private:
|
||||
const Zero& _ref() const { return *this; }
|
||||
int _rows() const { return m_rows; }
|
||||
|
Loading…
Reference in New Issue
Block a user