44 template<uint32_t... Rest>
51 template<uint32_t Lhs, uint32_t Rhs, uint32_t... Rest>
58 template <
typename V, u
int32_t S>
61 typedef typename V::template rebind<S>::type
type;
67 typedef typename V::value_type
type;
70 template <
typename V, u
int32_t S>
73 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes>
81 template <uint32_t Index, uint32_t...>
84 static constexpr uint32_t value = Index;
89 static_assert(
greater_than<vector_type::Size, Indexes...>::result,
"Swizzle too big");
90 assign(aRhs, &
v[Indexes]...);
93 template <
typename T,
typename SFINAE = std::enable_if_t<std::is_same_v<std::decay_t<T>, swizzle_rebind_t<vector_type, S>>, sfinae>>
96 static_assert(
greater_than<vector_type::Size, Indexes...>::result,
"Swizzle too big");
97 assign(std::begin(aRhs.v), &
v[Indexes]...);
101 template <
typename DestIter>
102 void copy(DestIter aDestination)
const
104 do_copy(aDestination, &
v[Indexes]...);
107 template <
typename Next,
typename... Rest>
108 void assign(
value_type aValue, Next aNext, Rest... aRest)
111 assign(aValue, aRest...);
113 template <
typename... Rest>
118 template <
typename SourceIter,
typename Next,
typename... Rest>
119 void assign(SourceIter aSource, Next aNext, Rest... aRest)
122 assign(aSource, aRest...);
124 template <
typename SourceIter,
typename... Rest>
125 void assign(SourceIter, Rest...)
129 template <
typename DestIter,
typename Next,
typename... Rest>
130 void do_copy(DestIter aDestination, Next aNext, Rest... aRest)
const
132 *aDestination++ = *aNext;
133 do_copy(aDestination, aRest...);
135 template <
typename DestIter,
typename... Rest>
136 void do_copy(DestIter, Rest...)
const
146 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1>
150 aArg.
copy(&result.v[0]);
154 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
157 return ~aLhs + ~aRhs;
160 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
163 return ~aLhs - ~aRhs;
166 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
169 return ~aLhs * ~aRhs;
172 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
175 return ~aLhs / ~aRhs;
178 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
181 return ~aLhs < ~aRhs;
184 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
187 return ~aLhs <= ~aRhs;
190 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
193 return ~aLhs > ~aRhs;
196 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
199 return ~aLhs >= ~aRhs;
202 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
205 return ~aLhs == ~aRhs;
208 template <
typename V,
typename A, uint32_t S, uint32_t... Indexes1, uint32_t... Indexes2>
211 return ~aLhs != ~aRhs;
217using neolib::math::operators::operator~;
218using neolib::math::operators::operator+;
219using neolib::math::operators::operator-;
220using neolib::math::operators::operator*;
221using neolib::math::operators::operator/;
222using neolib::math::operators::operator<;
223using neolib::math::operators::operator>;
224using neolib::math::operators::operator<=;
225using neolib::math::operators::operator>=;
226using neolib::math::operators::operator==;
227using neolib::math::operators::operator!=;
bool operator>=(const neolib::math::swizzle< V, A, S, Indexes1... > &aLhs, const neolib::math::swizzle< V, A, S, Indexes2... > &aRhs)
bool operator>(const neolib::math::swizzle< V, A, S, Indexes1... > &aLhs, const neolib::math::swizzle< V, A, S, Indexes2... > &aRhs)
neolib::math::swizzle_rebind_t< V, S > operator*(const neolib::math::swizzle< V, A, S, Indexes1... > &aLhs, const neolib::math::swizzle< V, A, S, Indexes2... > &aRhs)
typename swizzle_rebind< V, S >::type swizzle_rebind_t
V::template rebind< S >::type type
swizzle & operator=(const T &aRhs)
array_type::value_type value_type
swizzle & operator=(const value_type &aRhs)
void copy(DestIter aDestination) const