clarify the situation with EI_INHERIT_ASSIGNMENT_OPERATORS

This commit is contained in:
Benoit Jacob 2007-10-15 06:11:59 +00:00
parent 884a718b0a
commit d6f26dc8eb
9 changed files with 15 additions and 1 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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; }

View File

@ -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:

View File

@ -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:

View File

@ -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; }

View File

@ -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:

View File

@ -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:

View File

@ -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; }