Make constructors explicit if they could lead to unintended implicit conversion

This commit is contained in:
Christoph Hertzberg
2014-09-23 14:28:23 +02:00
parent de0d8a010e
commit 36448c9e28
93 changed files with 416 additions and 355 deletions

View File

@@ -192,7 +192,7 @@ struct evaluator<MappedSparseMatrix<_Scalar,_Options,_Index> >
};
evaluator() : m_matrix(0) {}
evaluator(const MappedSparseMatrixType &mat) : m_matrix(&mat) {}
explicit evaluator(const MappedSparseMatrixType &mat) : m_matrix(&mat) {}
operator MappedSparseMatrixType&() { return m_matrix->const_cast_derived(); }
operator const MappedSparseMatrixType&() const { return *m_matrix; }