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/Geometry/Quaternion.h | |
parent | de0d8a010e8cee66901786e0e2819beeaa5cb253 (diff) |
Make constructors explicit if they could lead to unintended implicit conversion
Diffstat (limited to 'Eigen/src/Geometry/Quaternion.h')
-rw-r--r-- | Eigen/src/Geometry/Quaternion.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h index 3f0067286..216e5b12f 100644 --- a/Eigen/src/Geometry/Quaternion.h +++ b/Eigen/src/Geometry/Quaternion.h @@ -251,7 +251,7 @@ public: inline Quaternion(const Scalar& w, const Scalar& x, const Scalar& y, const Scalar& z) : m_coeffs(x, y, z, w){} /** Constructs and initialize a quaternion from the array data */ - inline Quaternion(const Scalar* data) : m_coeffs(data) {} + explicit inline Quaternion(const Scalar* data) : m_coeffs(data) {} /** Copy constructor */ template<class Derived> EIGEN_STRONG_INLINE Quaternion(const QuaternionBase<Derived>& other) { this->Base::operator=(other); } @@ -351,7 +351,7 @@ class Map<const Quaternion<_Scalar>, _Options > * \code *coeffs == {x, y, z, w} \endcode * * If the template parameter _Options is set to #Aligned, then the pointer coeffs must be aligned. */ - EIGEN_STRONG_INLINE Map(const Scalar* coeffs) : m_coeffs(coeffs) {} + explicit EIGEN_STRONG_INLINE Map(const Scalar* coeffs) : m_coeffs(coeffs) {} inline const Coefficients& coeffs() const { return m_coeffs;} @@ -388,7 +388,7 @@ class Map<Quaternion<_Scalar>, _Options > * \code *coeffs == {x, y, z, w} \endcode * * If the template parameter _Options is set to #Aligned, then the pointer coeffs must be aligned. */ - EIGEN_STRONG_INLINE Map(Scalar* coeffs) : m_coeffs(coeffs) {} + explicit EIGEN_STRONG_INLINE Map(Scalar* coeffs) : m_coeffs(coeffs) {} inline Coefficients& coeffs() { return m_coeffs; } inline const Coefficients& coeffs() const { return m_coeffs; } |