Template Struct Vec< 3, T >#
Defined in File Vec3.h
Struct Documentation#
-
template<typename T>
struct Vec<3, T># Struct for a 3-dimensional vector.
Public Types
-
using pointer = value_type*#
-
using const_pointer = const value_type*#
-
using reference = value_type&#
-
using const_reference = const value_type&#
Public Functions
-
constexpr Vec() noexcept = default#
Constructor.
-
constexpr ~Vec() = default#
Destructor.
-
constexpr const T &x() const noexcept#
Retrieve the x component of the vector.
- Returns:
x component.
-
constexpr const T &y() const noexcept#
Retrieve the y component of the vector.
- Returns:
y component.
-
constexpr const T &z() const noexcept#
Retrieve the z component of the vector.
- Returns:
z component.
-
constexpr T &operator[](usize i) noexcept#
Returns a reference to the element at specified location i.
Note
No bounds checking is performed.
- Parameters:
i – Position of the element to return.
- Returns:
Reference to the requested element.
-
constexpr const T &operator[](usize i) const noexcept#
Returns a constant reference to the element at specified location i.
Note
No bounds checking is performed.
- Parameters:
i – Position of the element to return.
- Returns:
Constant reference to the requested element.
-
constexpr T &at(usize i)#
Returns a reference to the element at specified location i, with bounds checking via asserts.
- Parameters:
i – Position of the element to return.
- Returns:
Reference to the requested element.
-
constexpr const T &at(usize i) const#
Returns a constant reference to the element at specified location i, with bounds checking via asserts.
- Parameters:
i – Position of the element to return.
- Returns:
Constant reference to the requested element.
-
constexpr const_iterator begin() const noexcept#
Returns an iterator to the first element of the vector.
- Returns:
Iterator to the first element.
-
constexpr iterator begin() noexcept#
Returns an iterator to the first element of the vector.
- Returns:
Iterator to the first element.
-
constexpr const_iterator cbegin() const noexcept#
Returns an iterator to the first element of the vector.
- Returns:
Iterator to the first element.
-
constexpr const_reverse_iterator rbegin() const noexcept#
Returns a reverse iterator to the first element of the reversed vector. It corresponds to the last element of the non-reversed vector.
- Returns:
Reverse iterator to the first element.
-
constexpr reverse_iterator rbegin() noexcept#
Returns a reverse iterator to the first element of the reversed vector. It corresponds to the last element of the non-reversed vector.
- Returns:
Reverse iterator to the first element.
-
constexpr const_reverse_iterator crbegin() const noexcept#
Returns a reverse iterator to the first element of the reversed vector. It corresponds to the last element of the non-reversed vector.
- Returns:
Reverse iterator to the first element.
-
constexpr const_iterator end() const noexcept#
Returns an iterator to the element following the last element of the vector.
Note
This element acts as a placeholder; attempting to access it results in undefined behaviour.
- Returns:
Iterator to the element following the last element.
-
constexpr iterator end() noexcept#
Returns an iterator to the element following the last element of the vector.
Note
This element acts as a placeholder; attempting to access it results in undefined behaviour.
- Returns:
Iterator to the element following the last element.
-
constexpr const_iterator cend() const noexcept#
Returns an iterator to the element following the last element of the vector.
Note
This element acts as a placeholder; attempting to access it results in undefined behaviour.
- Returns:
Iterator to the element following the last element.
-
constexpr const_reverse_iterator rend() const noexcept#
Returns a reverse iterator to the element following the last element of the reversed vector. It corresponds to the element preceding the first element of the non-reversed vector.
Note
This element acts as a placeholder; attempting to access it results in undefined behaviour.
- Returns:
Reverse iterator to the element following the last element.
-
constexpr reverse_iterator rend() noexcept#
Returns a reverse iterator to the element following the last element of the reversed vector. It corresponds to the element preceding the first element of the non-reversed vector.
Note
This element acts as a placeholder; attempting to access it results in undefined behaviour.
- Returns:
Reverse iterator to the element following the last element.
-
constexpr const_reverse_iterator crend() const noexcept#
Returns a reverse iterator to the element following the last element of the reversed vector. It corresponds to the element preceding the first element of the non-reversed vector.
Note
This element acts as a placeholder; attempting to access it results in undefined behaviour.
- Returns:
Reverse iterator to the element following the last element.
-
using pointer = value_type*#