|
|
|
@ -362,9 +362,7 @@ public:
|
|
|
|
|
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
|
|
|
|
|
// component names (x<->r) and permutations (xy<->yx)
|
|
|
|
|
#define _DEFINE_SWIZZLER2(a, b, name) \
|
|
|
|
|
[[nodiscard]] constexpr Vec2<T> name() const { \
|
|
|
|
|
return Vec2<T>(a, b); \
|
|
|
|
|
}
|
|
|
|
|
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
|
|
|
|
|
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
|
|
|
|
|
_DEFINE_SWIZZLER2(a, b, a##b); \
|
|
|
|
|
_DEFINE_SWIZZLER2(a, b, a2##b2); \
|
|
|
|
@ -557,9 +555,7 @@ public:
|
|
|
|
|
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
|
|
|
|
|
// permutations (xy<->yx)
|
|
|
|
|
#define _DEFINE_SWIZZLER2(a, b, name) \
|
|
|
|
|
[[nodiscard]] constexpr Vec2<T> name() const { \
|
|
|
|
|
return Vec2<T>(a, b); \
|
|
|
|
|
}
|
|
|
|
|
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
|
|
|
|
|
#define DEFINE_SWIZZLER2_COMP1(a, a2) \
|
|
|
|
|
_DEFINE_SWIZZLER2(a, a, a##a); \
|
|
|
|
|
_DEFINE_SWIZZLER2(a, a, a2##a2)
|
|
|
|
@ -584,9 +580,7 @@ public:
|
|
|
|
|
#undef _DEFINE_SWIZZLER2
|
|
|
|
|
|
|
|
|
|
#define _DEFINE_SWIZZLER3(a, b, c, name) \
|
|
|
|
|
[[nodiscard]] constexpr Vec3<T> name() const { \
|
|
|
|
|
return Vec3<T>(a, b, c); \
|
|
|
|
|
}
|
|
|
|
|
[[nodiscard]] constexpr Vec3<T> name() const { return Vec3<T>(a, b, c); }
|
|
|
|
|
#define DEFINE_SWIZZLER3_COMP1(a, a2) \
|
|
|
|
|
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \
|
|
|
|
|
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)
|
|
|
|
|