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

@@ -27,7 +27,7 @@ class AmbiVector
typedef _Index Index;
typedef typename NumTraits<Scalar>::Real RealScalar;
AmbiVector(Index size)
explicit AmbiVector(Index size)
: m_buffer(0), m_zero(0), m_size(0), m_allocatedSize(0), m_allocatedElements(0), m_mode(-1)
{
resize(size);
@@ -288,7 +288,7 @@ class AmbiVector<_Scalar,_Index>::Iterator
* In practice, all coefficients having a magnitude smaller than \a epsilon
* are skipped.
*/
Iterator(const AmbiVector& vec, const RealScalar& epsilon = 0)
explicit Iterator(const AmbiVector& vec, const RealScalar& epsilon = 0)
: m_vector(vec)
{
using std::abs;