26 static constexpr size_t size = 4;
29 explicit constexpr rvec(T &a, T &b, T &c, T &d) : x{ a }, y{ b }, z{ c }, w{ d } {}
32 explicit constexpr rvec(T &other)
requires(V::size >= size) : x{ other.x }, y{ other.y }, z{ other.z }, w{ other.w } {}
35 explicit constexpr rvec(T
const &other)
requires(V::size >= size && std::is_const_v<typename V::type>) : x{ other.x }, y{ other.y }, z{ other.z }, w{ other.w } {}
48 for (
size_t i = 0; i < size; i++)
58 for (
size_t i = 0; i < size; i++)
66 constexpr void reset() noexcept;
69 [[nodiscard]] constexpr
rvec<4, T> const &operator+() const noexcept;
71 [[nodiscard]] constexpr
vec<4, T> operator-() const noexcept;
74 constexpr
rvec<4, T> &operator+=(U const value) noexcept;
76 constexpr
rvec<4, T> &operator-=(U const value) noexcept;
78 constexpr
rvec<4, T> &operator*=(U const value) noexcept;
80 constexpr
rvec<4, T> &operator/=(U const value) noexcept;
82 constexpr
rvec<4, T> &operator%=(U const value) noexcept;
84 constexpr
rvec<4, T> &operator+=(U const &other) noexcept requires(size == U::size);
86 constexpr
rvec<4, T> &operator-=(U const &other) noexcept requires(size == U::size);
88 constexpr
rvec<4, T> &operator*=(U const &other) noexcept requires(size == U::size);
90 constexpr
rvec<4, T> &operator/=(U const &other) noexcept requires(size == U::size);
92 constexpr
rvec<4, T> &operator%=(U const &other) noexcept requires(size == U::size);
95 [[nodiscard]] constexpr T &operator[](
size_t i);
97 [[nodiscard]] constexpr T const &operator[](
size_t i) const;
108 template <
size_t n = size>
109 [[nodiscard]]
constexpr rvec<n, T> as_rvec() noexcept requires(n >= 2 && n <= size);
118 template <
size_t n = size,
Primitive U = T>
119 [[nodiscard]] constexpr
vec<n,
std::remove_const_t<U>>
as_vec() const noexcept requires(n >= 2 && n <= size);
126 template <
size_t n = size>
127 [[nodiscard]] constexpr
rvec<n, const T>
as_crvec() const noexcept requires(n >= 2 && n <= size);
150 std::array<_detail::primitive_reference_wrapper<T>, 4>
data;