26 static constexpr size_t size = 3;
28 explicit constexpr rvec(T &a, T &b, T &c) : x{ a }, y{ b }, z{ c } {}
31 explicit constexpr rvec(V &other)
requires(V::size >= size) : x{ other.x }, y{ other.y }, z{ other.z } {}
34 explicit constexpr rvec(V
const &other)
requires(V::size >= size && std::is_const_v<typename V::type>) : x{ other.x }, y{ other.y }, z{ other.z } {}
42 constexpr void reset() noexcept;
45 constexpr
rvec<size, T> &operator=(
rvec<size, U> const &b)
47 for (
size_t i = 0; i < size; i++)
45 constexpr
rvec<size, T> &operator=(
rvec<size, U> const &b) {
…}
57 for (
size_t i = 0; i < size; i++)
67 [[nodiscard]] constexpr
vec<3, T> operator-() const noexcept;
70 constexpr
rvec<3, T> &operator+=(U const value) noexcept;
72 constexpr
rvec<3, T> &operator-=(U const value) noexcept;
74 constexpr
rvec<3, T> &operator*=(U const value) noexcept;
76 constexpr
rvec<3, T> &operator/=(U const value) noexcept;
78 constexpr
rvec<3, T> &operator%=(U const value) noexcept;
80 constexpr
rvec<3, T> &operator+=(U const &other) noexcept requires(size == U::size);
82 constexpr
rvec<3, T> &operator-=(U const &other) noexcept requires(size == U::size);
84 constexpr
rvec<3, T> &operator*=(U const &other) noexcept requires(size == U::size);
86 constexpr
rvec<3, T> &operator/=(U const &other) noexcept requires(size == U::size);
88 constexpr
rvec<3, T> &operator%=(U const &other) noexcept requires(size == U::size);
91 [[nodiscard]] constexpr T &operator[](
size_t i);
93 [[nodiscard]] constexpr T const &operator[](
size_t i) const;
104 template <
size_t n = size>
105 [[nodiscard]]
constexpr rvec<n, T> as_rvec() noexcept requires(n >= 2 && n <= size);
114 template <
size_t n = size,
Primitive U = T>
115 [[nodiscard]] constexpr
vec<n,
std::remove_const_t<U>>
as_vec() const noexcept requires(n >= 2 && n <= size);
123 template <
size_t n = size>
124 [[nodiscard]] constexpr
rvec<n, const T>
as_crvec() const noexcept requires(n >= 2 && n <= size);
143 std::array<_detail::primitive_reference_wrapper<T>, 3>
data;
constexpr mat< T::size.x, T::size.y, std::remove_const_t< typename T::type > > operator+(U const left, T const &right)
Adds a matrix to a primitive.