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

@@ -443,7 +443,7 @@ namespace internal {
Index m_end;
public:
EIGEN_STRONG_INLINE GenericSparseBlockInnerIteratorImpl(const BlockType& block, Index outer = 0)
explicit EIGEN_STRONG_INLINE GenericSparseBlockInnerIteratorImpl(const BlockType& block, Index outer = 0)
:
m_block(block),
m_outerPos( (IsRowMajor ? block.m_startCol.value() : block.m_startRow.value()) - 1), // -1 so that operator++ finds the first non-zero entry
@@ -512,7 +512,7 @@ struct unary_evaluator<Block<ArgType,BlockRows,BlockCols,InnerPanel>, IteratorBa
typedef typename internal::conditional<OuterVector,OuterVectorInnerIterator,InnerVectorInnerIterator>::type InnerIterator;
unary_evaluator(const XprType& op)
explicit unary_evaluator(const XprType& op)
: m_argImpl(op.nestedExpression()), m_block(op)
{}