mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-23 21:34:30 +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
|
Scalar _read(int row, int col) const
|
||||||
{
|
{
|
||||||
return Conj(m_matrix.read(row, col));
|
return NumTraits<Scalar>::conj(m_matrix.read(row, col));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -47,6 +47,7 @@ template<typename Lhs, typename Rhs> class Difference
|
|||||||
Difference(const Difference& other)
|
Difference(const Difference& other)
|
||||||
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
|
: 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)
|
EI_INHERIT_ASSIGNMENT_OPERATORS(Difference)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -42,6 +42,9 @@ template<typename MatrixType> class Identity
|
|||||||
assert(RowsAtCompileTime == ColsAtCompileTime);
|
assert(RowsAtCompileTime == ColsAtCompileTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assignments are illegal but we still want to intercept them and get clean compile errors
|
||||||
|
EI_INHERIT_ASSIGNMENT_OPERATORS(Identity)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Identity& _ref() { return *this; }
|
Identity& _ref() { return *this; }
|
||||||
const Identity& _ref() const { return *this; }
|
const Identity& _ref() const { return *this; }
|
||||||
|
@ -42,6 +42,7 @@ template<typename MatrixType> class Opposite
|
|||||||
Opposite(const Opposite& other)
|
Opposite(const Opposite& other)
|
||||||
: m_matrix(other.m_matrix) {}
|
: 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)
|
EI_INHERIT_ASSIGNMENT_OPERATORS(Opposite)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -82,6 +82,7 @@ template<typename Lhs, typename Rhs> class Product
|
|||||||
Product(const Product& other)
|
Product(const Product& other)
|
||||||
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
|
: 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)
|
EI_INHERIT_ASSIGNMENT_OPERATORS(Product)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -40,6 +40,9 @@ template<typename MatrixType> class Random
|
|||||||
{
|
{
|
||||||
assert(rows > 0 && cols > 0);
|
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:
|
private:
|
||||||
const Random& _ref() const { return *this; }
|
const Random& _ref() const { return *this; }
|
||||||
|
@ -43,6 +43,7 @@ template<typename MatrixType> class ScalarMultiple
|
|||||||
ScalarMultiple(const ScalarMultiple& other)
|
ScalarMultiple(const ScalarMultiple& other)
|
||||||
: m_matrix(other.m_matrix), m_scalar(other.m_scalar) {}
|
: 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)
|
EI_INHERIT_ASSIGNMENT_OPERATORS(ScalarMultiple)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -47,6 +47,7 @@ template<typename Lhs, typename Rhs> class Sum
|
|||||||
Sum(const Sum& other)
|
Sum(const Sum& other)
|
||||||
: m_lhs(other.m_lhs), m_rhs(other.m_rhs) {}
|
: 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)
|
EI_INHERIT_ASSIGNMENT_OPERATORS(Sum)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -41,6 +41,9 @@ template<typename MatrixType> class Zero
|
|||||||
assert(rows > 0 && cols > 0);
|
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:
|
private:
|
||||||
const Zero& _ref() const { return *this; }
|
const Zero& _ref() const { return *this; }
|
||||||
int _rows() const { return m_rows; }
|
int _rows() const { return m_rows; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user