5 template <
size_t L, Primitive T>
9 for (
int i = 0; i < size; i++)
11 data[i] =
static_cast<T
>(value);
14 template <
size_t L, Primitive T>
15 template <
typename... U>
18 static_assert(get_parameter_pack_size<U...>() == size,
19 "You have provided wrong amount of data");
20 unpack_data(0, data...);
22 template <
size_t L, Primitive T>
25 for (
int i = 0; i < size; i++)
31 template <
size_t L, Primitive T>
32 template <Primitive U>
35 for (
int i = 0; i < size; i++)
37 data[i] =
static_cast<T
>(data[i] + value);
41 template <
size_t L, Primitive T>
42 template <Primitive U>
45 for (
int i = 0; i < size; i++)
47 data[i] =
static_cast<T
>(data[i] - value);
51 template <
size_t L, Primitive T>
52 template <Primitive U>
55 for (
int i = 0; i < size; i++)
57 data[i] =
static_cast<T
>(data[i] * value);
61 template <
size_t L, Primitive T>
62 template <Primitive U>
65 for (
int i = 0; i < size; i++)
67 data[i] =
static_cast<T
>(data[i] / value);
71 template <
size_t L, Primitive T>
72 template <Primitive U>
75 for (
int i = 0; i < size; i++)
77 data[i] =
static_cast<T
>(data[i] % value);
81 template <
size_t L, Primitive T>
85 for (
int i = 0; i < size; i++)
87 data[i] =
static_cast<T
>(data[i] + other.data[i]);
91 template <
size_t L, Primitive T>
95 for (
int i = 0; i < size; i++)
97 data[i] =
static_cast<T
>(data[i] - other.data[i]);
101 template <
size_t L, Primitive T>
105 for (
int i = 0; i < size; i++)
107 data[i] =
static_cast<T
>(data[i] * other.data[i]);
111 template <
size_t L, Primitive T>
115 for (
int i = 0; i < size; i++)
117 data[i] =
static_cast<T
>(data[i] / other.data[i]);
121 template <
size_t L, Primitive T>
125 for (
int i = 0; i < size; i++)
127 data[i] =
static_cast<T
>(data[i] % other.data[i]);
132 template <
size_t L, Primitive T>
138 template <
size_t L, Primitive T>
144 template <
size_t L, Primitive T>
145 template <Primitive _>
150 template <
size_t L, Primitive T>
156 template <
size_t L, Primitive T>
157 template <
typename A,
typename B,
typename... C>
160 return get_parameter_pack_size<A>() + get_parameter_pack_size<B, C...>();
91 template <
size_t L, Primitive T> {
…}
87 data[i] =
static_cast<T
>(data[i] + other.data[i]); {
…}
85 for (
int i = 0; i < size; i++) {
…}
81 template <
size_t L, Primitive T> {
…}
77 data[i] =
static_cast<T
>(data[i] % value); {
…}
75 for (
int i = 0; i < size; i++) {
…}
61 template <
size_t L, Primitive T> {
…}
45 for (
int i = 0; i < size; i++) {
…}
37 data[i] =
static_cast<T
>(data[i] + value); {
…}
Contains mathematical utility functions and classes.
Definition of the mathematical vector with fixed size L and type T
constexpr T & operator[](size_t i)
Overloaded subscript operator for non-const rvec.
constexpr vec< L, T > & operator%=(U const value) noexcept
static constexpr size_t get_parameter_pack_size()
Determines the size of a parameter pack for primitive types.
constexpr vec< L, T > & operator*=(U const value) noexcept
constexpr vec< L, T > & operator/=(U const value) noexcept
constexpr vec()=default
Default constructor.
constexpr vec< L, T > & operator+=(U const value) noexcept
constexpr vec< L, T > & operator-=(U const value) noexcept
constexpr void reset() noexcept
Resets the vector to the zero vector.
Contains the definition of the generic vec<L, T> structure.