diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-09-23 14:28:23 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2014-09-23 14:28:23 +0200 |
commit | 36448c9e287935b8c408791bf88b2907292d6c80 (patch) | |
tree | 841afdf4ea165433ad3b0f797498441815344eeb /Eigen/src/SparseCore/SparseView.h | |
parent | de0d8a010e8cee66901786e0e2819beeaa5cb253 (diff) |
Make constructors explicit if they could lead to unintended implicit conversion
Diffstat (limited to 'Eigen/src/SparseCore/SparseView.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseView.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/SparseCore/SparseView.h b/Eigen/src/SparseCore/SparseView.h index d10cc5a35..40a3019fa 100644 --- a/Eigen/src/SparseCore/SparseView.h +++ b/Eigen/src/SparseCore/SparseView.h @@ -36,7 +36,7 @@ public: EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) typedef typename internal::remove_all<MatrixType>::type NestedExpression; - SparseView(const MatrixType& mat, const Scalar& m_reference = Scalar(0), + explicit SparseView(const MatrixType& mat, const Scalar& m_reference = Scalar(0), RealScalar m_epsilon = NumTraits<Scalar>::dummy_precision()) : m_matrix(mat), m_reference(m_reference), m_epsilon(m_epsilon) {} @@ -111,7 +111,7 @@ struct unary_evaluator<SparseView<ArgType>, IteratorBased> Flags = XprType::Flags }; - unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {} + explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {} protected: typename evaluator<ArgType>::nestedType m_argImpl; @@ -180,7 +180,7 @@ struct unary_evaluator<SparseView<ArgType>, IndexBased> Flags = XprType::Flags }; - unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {} + explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {} protected: typename evaluator<ArgType>::nestedType m_argImpl; |