diff --git a/src/OpenMesh/Core/Geometry/VectorT.hh b/src/OpenMesh/Core/Geometry/VectorT.hh index 38a463e8..7be16f0e 100644 --- a/src/OpenMesh/Core/Geometry/VectorT.hh +++ b/src/OpenMesh/Core/Geometry/VectorT.hh @@ -92,6 +92,23 @@ namespace OpenMesh { //== CLASS DEFINITION ========================================================= +#if CPP11_ENABLED +/* + * Helpers for VectorT + */ +namespace { +template +struct are_convertible_to; + +template +struct are_convertible_to { + static constexpr bool value = std::is_convertible::value && are_convertible_to::value; +}; +template +struct are_convertible_to : public std::is_convertible {}; +} +#endif + /** The N values of the template Scalar type are the only data members of the class VectorT. This guarantees 100% compatibility diff --git a/src/OpenMesh/Core/Geometry/VectorT_inc.hh b/src/OpenMesh/Core/Geometry/VectorT_inc.hh index 6fd4d3c3..3f045a19 100644 --- a/src/OpenMesh/Core/Geometry/VectorT_inc.hh +++ b/src/OpenMesh/Core/Geometry/VectorT_inc.hh @@ -102,8 +102,10 @@ public: vectorize(v); } - template::type> - constexpr VectorT(T... vs) : Base {vs...} + template::type, + typename = typename std::enable_if::value>::type> + constexpr VectorT(T... vs) : Base { static_cast(vs)...} { } #else /// special constructor for 1D vectors