Make non-conversion unary constructors explicit.

This commit is contained in:
Chen-Pang He 2013-07-11 02:31:13 +08:00
parent 4466875d54
commit a992fa74eb
3 changed files with 9 additions and 9 deletions

View File

@ -32,7 +32,7 @@ class MatrixExponential : internal::noncopyable
*
* \param[in] M matrix whose exponential is to be computed.
*/
MatrixExponential(const MatrixType &M);
explicit MatrixExponential(const MatrixType &M);
/** \brief Computes the matrix exponential.
*
@ -415,7 +415,7 @@ template<typename Derived> struct MatrixExponentialReturnValue
* \param[in] src %Matrix (expression) forming the argument of the
* matrix exponential.
*/
MatrixExponentialReturnValue(const Derived& src) : m_src(src) { }
explicit MatrixExponentialReturnValue(const Derived& src) : m_src(src) { }
/** \brief Compute the matrix exponential.
*

View File

@ -425,7 +425,7 @@ public:
*
* \param[in] A %Matrix (expression) forming the argument of the matrix logarithm.
*/
MatrixLogarithmReturnValue(const Derived& A) : m_A(A) { }
explicit MatrixLogarithmReturnValue(const Derived& A) : m_A(A) { }
/** \brief Compute the matrix logarithm.
*

View File

@ -36,7 +36,7 @@ class MatrixSquareRootQuasiTriangular : internal::noncopyable
* The class stores a reference to \p A, so it should not be
* changed (or destroyed) before compute() is called.
*/
MatrixSquareRootQuasiTriangular(const MatrixType& A)
explicit MatrixSquareRootQuasiTriangular(const MatrixType& A)
: m_A(A)
{
eigen_assert(A.rows() == A.cols());
@ -256,7 +256,7 @@ template <typename MatrixType>
class MatrixSquareRootTriangular : internal::noncopyable
{
public:
MatrixSquareRootTriangular(const MatrixType& A)
explicit MatrixSquareRootTriangular(const MatrixType& A)
: m_A(A)
{
eigen_assert(A.rows() == A.cols());
@ -321,7 +321,7 @@ class MatrixSquareRoot
* The class stores a reference to \p A, so it should not be
* changed (or destroyed) before compute() is called.
*/
MatrixSquareRoot(const MatrixType& A);
explicit MatrixSquareRoot(const MatrixType& A);
/** \brief Compute the matrix square root
*
@ -341,7 +341,7 @@ class MatrixSquareRoot<MatrixType, 0>
{
public:
MatrixSquareRoot(const MatrixType& A)
explicit MatrixSquareRoot(const MatrixType& A)
: m_A(A)
{
eigen_assert(A.rows() == A.cols());
@ -374,7 +374,7 @@ class MatrixSquareRoot<MatrixType, 1> : internal::noncopyable
{
public:
MatrixSquareRoot(const MatrixType& A)
explicit MatrixSquareRoot(const MatrixType& A)
: m_A(A)
{
eigen_assert(A.rows() == A.cols());
@ -422,7 +422,7 @@ template<typename Derived> class MatrixSquareRootReturnValue
* \param[in] src %Matrix (expression) forming the argument of the
* matrix square root.
*/
MatrixSquareRootReturnValue(const Derived& src) : m_src(src) { }
explicit MatrixSquareRootReturnValue(const Derived& src) : m_src(src) { }
/** \brief Compute the matrix square root.
*