From a7c114cf5ff916716921cf1a25208977d25b2481 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 11 Jan 2023 14:10:07 +0000 Subject: [PATCH] Make swizzles explicit --- include/Orange/Math/Swizzle.h | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/include/Orange/Math/Swizzle.h b/include/Orange/Math/Swizzle.h index 70e3ac7..ec5cb38 100644 --- a/include/Orange/Math/Swizzle.h +++ b/include/Orange/Math/Swizzle.h @@ -88,12 +88,8 @@ namespace orange copy(&components[0], &components[2], data.begin()); } - template - constexpr Swizzle(const Args&... args) - : data {{ args... }} - { - static_assert(sizeof...(Args) == 2); - } + constexpr Swizzle(T x, T y) + : data {{ x, y }} {} constexpr Swizzle(const Swizzle& other) = default; }; @@ -131,12 +127,8 @@ namespace orange copy(&components[0], &components[3], data.begin()); } - template - constexpr Swizzle(const Args&... args) - : data {{ args... }} - { - static_assert(sizeof...(Args) == 3); - } + constexpr Swizzle(T x, T y, T z) + : data {{ x, y, z }} {} constexpr Swizzle(const Swizzle& other) = default; }; @@ -176,12 +168,8 @@ namespace orange copy(&components[0], &components[4], data.begin()); } - template - constexpr Swizzle(const Args&... args) - : data {{ args... }} - { - static_assert(sizeof...(Args) == 4); - } + constexpr Swizzle(T x, T y, T z, T w) + : data {{ x, y, z, w }} {} constexpr Swizzle(const Swizzle& other) = default; };