Make swizzles explicit
This commit is contained in:
parent
63d2a6e318
commit
a7c114cf5f
|
@ -88,12 +88,8 @@ namespace orange
|
||||||
copy(&components[0], &components[2], data.begin());
|
copy(&components[0], &components[2], data.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
constexpr Swizzle(T x, T y)
|
||||||
constexpr Swizzle(const Args&... args)
|
: data {{ x, y }} {}
|
||||||
: data {{ args... }}
|
|
||||||
{
|
|
||||||
static_assert(sizeof...(Args) == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr Swizzle(const Swizzle& other) = default;
|
constexpr Swizzle(const Swizzle& other) = default;
|
||||||
};
|
};
|
||||||
|
@ -131,12 +127,8 @@ namespace orange
|
||||||
copy(&components[0], &components[3], data.begin());
|
copy(&components[0], &components[3], data.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
constexpr Swizzle(T x, T y, T z)
|
||||||
constexpr Swizzle(const Args&... args)
|
: data {{ x, y, z }} {}
|
||||||
: data {{ args... }}
|
|
||||||
{
|
|
||||||
static_assert(sizeof...(Args) == 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr Swizzle(const Swizzle& other) = default;
|
constexpr Swizzle(const Swizzle& other) = default;
|
||||||
};
|
};
|
||||||
|
@ -176,12 +168,8 @@ namespace orange
|
||||||
copy(&components[0], &components[4], data.begin());
|
copy(&components[0], &components[4], data.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
constexpr Swizzle(T x, T y, T z, T w)
|
||||||
constexpr Swizzle(const Args&... args)
|
: data {{ x, y, z, w }} {}
|
||||||
: data {{ args... }}
|
|
||||||
{
|
|
||||||
static_assert(sizeof...(Args) == 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr Swizzle(const Swizzle& other) = default;
|
constexpr Swizzle(const Swizzle& other) = default;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue