cleanup: remove copy contructors when the compiler is able to generate a satisfactory

default copy constructor; remove useless static_cast's; some misc cleanup.
This commit is contained in:
Benoit Jacob
2007-12-31 13:29:51 +00:00
parent 86220784b6
commit 42f6590bb2
21 changed files with 53 additions and 81 deletions

View File

@@ -32,12 +32,7 @@ template<typename MatrixType> class Zero : NoOperatorEquals,
public:
typedef typename MatrixType::Scalar Scalar;
friend class MatrixBase<Scalar, Zero<MatrixType> >;
Zero(int rows, int cols) : m_rows(rows), m_cols(cols)
{
assert(rows > 0 && cols > 0);
}
private:
static const int _RowsAtCompileTime = MatrixType::RowsAtCompileTime,
_ColsAtCompileTime = MatrixType::ColsAtCompileTime;
@@ -51,6 +46,15 @@ template<typename MatrixType> class Zero : NoOperatorEquals,
return static_cast<Scalar>(0);
}
public:
Zero(int rows, int cols) : m_rows(rows), m_cols(cols)
{
assert(rows > 0
&& (_RowsAtCompileTime == Dynamic || _RowsAtCompileTime == rows)
&& cols > 0
&& (_ColsAtCompileTime == Dynamic || _ColsAtCompileTime == cols));
}
protected:
int m_rows, m_cols;
};