use a more c++-ish way of preventing the compiler from generating default operator=

when it's not wanted. Thanks to Christian Mayer for the tip.
This commit is contained in:
Benoit Jacob
2007-12-12 16:52:17 +00:00
parent fa8009c6b7
commit 7ddc13b9fa
12 changed files with 28 additions and 55 deletions

View File

@@ -26,8 +26,8 @@
#ifndef EIGEN_CAST_H
#define EIGEN_CAST_H
template<typename NewScalar, typename MatrixType> class Cast
: public MatrixBase<NewScalar, Cast<NewScalar, MatrixType> >
template<typename NewScalar, typename MatrixType> class Cast : NoDefaultOperatorEquals,
public MatrixBase<NewScalar, Cast<NewScalar, MatrixType> >
{
public:
typedef NewScalar Scalar;
@@ -42,9 +42,6 @@ template<typename NewScalar, typename MatrixType> class Cast
Cast(const Cast& other)
: m_matrix(other.m_matrix) {}
// assignments are illegal but we still want to intercept them and get clean compile errors
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Cast)
private:
const Cast& _ref() const { return *this; }
int _rows() const { return m_matrix.rows(); }