this explicit keyword can't hurt

This commit is contained in:
Benoit Jacob 2009-10-31 11:49:20 -04:00
parent 6a90f6c5f0
commit c64ca6870e

View File

@ -159,7 +159,7 @@ template<typename Derived> class MatrixBase
inline int size() const { return rows() * cols(); } inline int size() const { return rows() * cols(); }
/** \returns the number of nonzero coefficients which is in practice the number /** \returns the number of nonzero coefficients which is in practice the number
* of stored coefficients. */ * of stored coefficients. */
inline int nonZeros() const { return size(); } inline int nonZeros() const { return derived.nonZeros(); }
/** \returns true if either the number of rows or the number of columns is equal to 1. /** \returns true if either the number of rows or the number of columns is equal to 1.
* In other words, this function returns * In other words, this function returns
* \code rows()==1 || cols()==1 \endcode * \code rows()==1 || cols()==1 \endcode
@ -636,7 +636,7 @@ template<typename Derived> class MatrixBase
} }
private: private:
MatrixBase(int); explicit MatrixBase(int);
MatrixBase(int,int); MatrixBase(int,int);
template<typename OtherDerived> explicit MatrixBase(const MatrixBase<OtherDerived>&); template<typename OtherDerived> explicit MatrixBase(const MatrixBase<OtherDerived>&);
}; };