From 2a3d02d217706fe61b347b18fe6cc70feffbde01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Sep 2019 19:17:15 +0200 Subject: [PATCH] Math: an attempt to fix scatter() on GCC 4.8. --- src/Magnum/Math/Swizzle.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Math/Swizzle.h b/src/Magnum/Math/Swizzle.h index 16f0b28aa..d67b8bbd6 100644 --- a/src/Magnum/Math/Swizzle.h +++ b/src/Magnum/Math/Swizzle.h @@ -140,7 +140,14 @@ Inverse to @ref gather(), supporting the same component addressing except for @see @ref matrix-vector-component-access, @ref Vector4::xyz(), @ref Vector4::rgb(), @ref Vector4::xy(), @ref Vector3::xy() */ -template constexpr T scatter(const T& vector, const Vector& values) { +#ifdef DOXYGEN_GENERATING_OUTPUT +template constexpr T scatter(const T& vector, const Vector& values) +#else +/* Using std::common_type otherwise GCC 4.8 fails to match the arguments + in SwizzleTest::scatterOneComponent() */ +template constexpr T scatter(const T& vector, const typename std::common_type>::type& values) +#endif +{ return Implementation::scatterRecursive(vector, values, 0); }