diff --git a/src/OpenMesh/Core/Geometry/Vector11T.hh b/src/OpenMesh/Core/Geometry/Vector11T.hh index de31544c..c9d918ba 100644 --- a/src/OpenMesh/Core/Geometry/Vector11T.hh +++ b/src/OpenMesh/Core/Geometry/Vector11T.hh @@ -112,14 +112,16 @@ class VectorT { //-------------------------------------------------------------- constructors - template::type, + // Converting constructor: Constructs the vector from DIM values (of + // potentially heterogenous types) which are all convertible to Scalar. + template::type, typename = typename std::enable_if< - are_convertible_to::value>::type> - constexpr VectorT(T... vs) : values_ { {static_cast(vs)...} } { - static_assert(sizeof...(T) == DIM, + are_convertible_to::value>::type> + constexpr VectorT(T v, Ts... vs) : values_ { {static_cast(v), static_cast(vs)...} } { + static_assert(sizeof...(Ts)+1 == DIM, "Invalid number of components specified in constructor."); - static_assert(are_convertible_to::value, + static_assert(are_convertible_to::value, "Not all components are convertible to Scalar."); } @@ -367,8 +369,7 @@ class VectorT { auto operator% (const VectorT &_rhs) const -> typename std::enable_if>::type { + (*this)[0] * _rhs[0]), DIM>>::type { return { values_[1] * _rhs[2] - values_[2] * _rhs[1], values_[2] * _rhs[0] - values_[0] * _rhs[2],