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

@@ -185,7 +185,7 @@ public:
Flags = XprType::Flags
};
unary_evaluator(const XprType &xpr) : m_argImpl(xpr.nestedExpression()) {}
explicit unary_evaluator(const XprType &xpr) : m_argImpl(xpr.nestedExpression()) {}
class InnerIterator : public EvalIterator
{
@@ -269,7 +269,7 @@ template<int Mode>
inline const TriangularView<Derived, Mode>
SparseMatrixBase<Derived>::triangularView() const
{
return derived();
return TriangularView<Derived, Mode>(derived());
}
} // end namespace Eigen