14 template<length_t L,
typename R,
typename T, qualifier P>
17 template<
typename R,
typename T, qualifier P>
18 struct functor1<1, R, T, P>
20 GLM_FUNC_QUALIFIER
static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P>
const & v)
22 return vec<1, R, P>(Func(v.x));
26 template<
typename R,
typename T, qualifier P>
27 struct functor1<2, R, T, P>
29 GLM_FUNC_QUALIFIER
static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P>
const & v)
31 return vec<2, R, P>(Func(v.x), Func(v.y));
35 template<
typename R,
typename T, qualifier P>
36 struct functor1<3, R, T, P>
38 GLM_FUNC_QUALIFIER
static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P>
const & v)
40 return vec<3, R, P>(Func(v.x), Func(v.y), Func(v.z));
44 template<
typename R,
typename T, qualifier P>
45 struct functor1<4, R, T, P>
47 GLM_FUNC_QUALIFIER
static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P>
const & v)
49 return vec<4, R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
53 template<length_t L,
typename T, qualifier P>
56 template<
typename T, qualifier P>
57 struct functor2<1, T, P>
59 GLM_FUNC_QUALIFIER
static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P>
const & a, vec<1, T, P>
const & b)
61 return vec<1, T, P>(Func(a.x, b.x));
65 template<
typename T, qualifier P>
66 struct functor2<2, T, P>
68 GLM_FUNC_QUALIFIER
static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P>
const & a, vec<2, T, P>
const & b)
70 return vec<2, T, P>(Func(a.x, b.x), Func(a.y, b.y));
74 template<
typename T, qualifier P>
75 struct functor2<3, T, P>
77 GLM_FUNC_QUALIFIER
static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P>
const & a, vec<3, T, P>
const & b)
79 return vec<3, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
83 template<
typename T, qualifier P>
84 struct functor2<4, T, P>
86 GLM_FUNC_QUALIFIER
static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P>
const & a, vec<4, T, P>
const & b)
88 return vec<4, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
92 template<length_t L,
typename T, qualifier P>
93 struct functor2_vec_sca{};
95 template<
typename T, qualifier P>
96 struct functor2_vec_sca<1, T, P>
98 GLM_FUNC_QUALIFIER
static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P>
const & a, T b)
100 return vec<1, T, P>(Func(a.x, b));
104 template<
typename T, qualifier P>
105 struct functor2_vec_sca<2, T, P>
107 GLM_FUNC_QUALIFIER
static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P>
const & a, T b)
109 return vec<2, T, P>(Func(a.x, b), Func(a.y, b));
113 template<
typename T, qualifier P>
114 struct functor2_vec_sca<3, T, P>
116 GLM_FUNC_QUALIFIER
static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P>
const & a, T b)
118 return vec<3, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
122 template<
typename T, qualifier P>
123 struct functor2_vec_sca<4, T, P>
125 GLM_FUNC_QUALIFIER
static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P>
const & a, T b)
127 return vec<4, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));