template<typename T1, typename T2 = T1>
recti::Vector2 class

vector2

Constructors, destructors, conversion operators

Vector2(T1&& vec_x, T2&& vec_y) constexpr noexcept
Construct a new Vector2 object.
Vector2(const T1& vec_x, const T2& vec_y) constexpr
Construct a new Vector2 object.
template<typename U1, typename U2>
Vector2(const Vector2<U1, U2>& other) explicit constexpr
Construct a new Vector2 object.

Public functions

auto x() const noexcept -> const T1 & -> auto constexpr
auto y() const noexcept -> const T2 & -> auto constexpr
template<typename U1, typename U2>
auto cross(const Vector2<U1, U2>& other) const -> auto constexpr

Comparison operators

definie ==, !=, <, >, <=, >=.

template<typename U1, typename U2>
auto operator==(const Vector2<U1, U2>& other) const -> bool -> auto constexpr
Equal to.
template<typename U1, typename U2>
auto operator!=(const Vector2<U1, U2>& other) const -> bool -> auto constexpr
Not equal to.

Arithmetic operators

definie +, -, *, /, +=, -=, *=, /=, etc.

auto operator-() const -> Vector2 -> auto constexpr
Negate.
template<typename U1, typename U2>
auto operator+=(const Vector2<U1, U2>& other) -> Vector2 & -> CONSTEXPR14 auto
Add.
template<typename U1, typename U2>
auto operator-=(const Vector2<U1, U2>& other) -> Vector2 & -> CONSTEXPR14 auto
Substract.
template<typename R>
auto operator*=(const R& alpha) -> Vector2 & -> CONSTEXPR14 auto
Multiply.
template<typename R>
auto operator/=(const R& alpha) -> Vector2 & -> CONSTEXPR14 auto
Divide.
template<typename U1, typename U2>
auto operator+(Vector2 rhs, const Vector2<U1, U2>& lhs) -> Vector2 -> auto constexpr
Add.
template<typename U1, typename U2>
auto operator-(Vector2 rhs, const Vector2<U1, U2>& lhs) -> Vector2 -> auto constexpr
Substract.
template<typename R>
auto operator*(Vector2 rhs, const R& alpha) -> Vector2 -> auto constexpr
Multiply by a scalar.
template<typename R>
auto operator*(const R& alpha, Vector2 lhs) -> Vector2 -> auto constexpr
Multiply (by a scalar)
template<typename R>
auto operator/(Vector2 rhs, const R& alpha) -> Vector2 -> auto constexpr
Divide (by a scalar)

Friends

template<class Stream>
auto operator<<(Stream& out, const Vector2& vec2) -> Stream & -> auto

Function documentation

template<typename T1, typename T2>
recti::Vector2<T1, T2>::Vector2(T1&& vec_x, T2&& vec_y) constexpr noexcept

Construct a new Vector2 object.

This is a constructor for the Vector2 class. It takes two parameters vec_x and vec_y, both of which are rvalue references (T1&& and T2&&). The constructor is marked as constexpr, meaning it can be evaluated at compile-time. The constructor is also marked as noexcept, indicating that it does not throw any exceptions.

template<typename T1, typename T2> template<typename U1, typename U2>
recti::Vector2<T1, T2>::Vector2(const Vector2<U1, U2>& other) explicit constexpr

Construct a new Vector2 object.

Template parameters
U1
U2

template<typename T1, typename T2>
auto recti::Vector2<T1, T2>::x() const noexcept -> const T1 & constexpr

Returns constexpr const T1&

template<typename T1, typename T2>
auto recti::Vector2<T1, T2>::y() const noexcept -> const T2 & constexpr

Returns constexpr const T2&

template<typename T1, typename T2> template<typename U1, typename U2>
auto recti::Vector2<T1, T2>::cross(const Vector2<U1, U2>& other) const constexpr

Template parameters
U1
U2
Parameters
other in
Returns constexpr auto

template<typename T1, typename T2> template<typename U1, typename U2>
auto recti::Vector2<T1, T2>::operator==(const Vector2<U1, U2>& other) const -> bool constexpr

Equal to.

Template parameters
U1
U2
Parameters
other in
Returns true

template<typename T1, typename T2> template<typename U1, typename U2>
auto recti::Vector2<T1, T2>::operator!=(const Vector2<U1, U2>& other) const -> bool constexpr

Not equal to.

Template parameters
U1
U2
Parameters
other in
Returns true

template<typename T1, typename T2>
auto recti::Vector2<T1, T2>::operator-() const -> Vector2 constexpr

Negate.

Returns vector2

template<typename T1, typename T2> template<typename U1, typename U2>
CONSTEXPR14 auto recti::Vector2<T1, T2>::operator+=(const Vector2<U1, U2>& other) -> Vector2 &

Add.

Template parameters
U1
U2
Parameters
other in
Returns Vector2&

template<typename T1, typename T2> template<typename U1, typename U2>
CONSTEXPR14 auto recti::Vector2<T1, T2>::operator-=(const Vector2<U1, U2>& other) -> Vector2 &

Substract.

Template parameters
U1
U2
Parameters
other in
Returns Vector2&

template<typename T1, typename T2> template<typename R>
CONSTEXPR14 auto recti::Vector2<T1, T2>::operator*=(const R& alpha) -> Vector2 &

Multiply.

Template parameters
R
Parameters
alpha in
Returns Vector2&

template<typename T1, typename T2> template<typename R>
CONSTEXPR14 auto recti::Vector2<T1, T2>::operator/=(const R& alpha) -> Vector2 &

Divide.

Template parameters
R
Parameters
alpha in
Returns Vector2&

template<typename T1, typename T2> template<typename U1, typename U2>
auto recti::Vector2<T1, T2>::operator+(Vector2 rhs, const Vector2<U1, U2>& lhs) -> Vector2 constexpr

Add.

Template parameters
U1
U2
Returns vector2

template<typename T1, typename T2> template<typename U1, typename U2>
auto recti::Vector2<T1, T2>::operator-(Vector2 rhs, const Vector2<U1, U2>& lhs) -> Vector2 constexpr

Substract.

Template parameters
U1
U2
Returns vector2

template<typename T1, typename T2> template<typename R>
auto recti::Vector2<T1, T2>::operator*(Vector2 rhs, const R& alpha) -> Vector2 constexpr

Multiply by a scalar.

Template parameters
R
Parameters
rhs
alpha in
Returns vector2

template<typename T1, typename T2> template<typename R>
auto recti::Vector2<T1, T2>::operator*(const R& alpha, Vector2 lhs) -> Vector2 constexpr

Multiply (by a scalar)

Template parameters
R
Parameters
alpha in
lhs
Returns vector2

template<typename T1, typename T2> template<typename R>
auto recti::Vector2<T1, T2>::operator/(Vector2 rhs, const R& alpha) -> Vector2 constexpr

Divide (by a scalar)

Template parameters
R
Parameters
rhs
alpha in
Returns vector2

template<typename T1, typename T2> template<class Stream>
auto operator<<(Stream& out, const Vector2& vec2) -> Stream &

Template parameters
Stream
Parameters
out out
vec2
Returns Stream&