4.6.0
Freundlich's C++ toolkit
|
A class representing static n-dimensional vectors.
T | The vector's value_type |
N | The vector's dimension |
S | The vector's storage type |
See fcppt.math.vector for more information.
Public Types | |
using | dim_wrapper = fcppt::math::static_size<N> |
A typedef for the N parameter. | |
using | static_size = dim_wrapper |
The static size. | |
using | storage_type = S |
A typedef for the S parameter. | |
using | size_type = fcppt::math::size_type |
A type that counts the number of elements in a vector. | |
using | difference_type = fcppt::math::difference_type |
A type that provides the difference between the addresses of two elements in a vector. | |
using | value_type = T |
A type that represents the data type stored in a vector. | |
using | reference = typename storage_type::reference |
A type that provides a reference to an element stored in a vector. | |
using | const_reference = typename storage_type::const_reference |
A type that provides a reference to a const element stored in a vector for reading and performing const operations. | |
Public Member Functions | |
object (fcppt::no_init const &) | |
Construct an uninitialized vector. | |
object (storage_type &&) | |
Construct a vector from a storage source. | |
template<typename... Args> requires (std::conjunction_v< fcppt::math::is_static_storage<S>, std::bool_constant<sizeof...(Args) == N>, std::is_constructible<T, Args>...>) | |
constexpr | object (Args &&...) noexcept(std::conjunction_v< std::is_nothrow_constructible< T, Args >... >) |
template<typename OtherStorage > | |
object (fcppt::math::vector::object< T, N, OtherStorage > const &) | |
Create a vector from a vector with the same dimension and value type but different storage type. | |
template<typename OtherStorage > | |
object & | operator= (fcppt::math::vector::object< T, N, OtherStorage > const &) |
Copy the values from a different vector. | |
template<typename S2 > | |
object & | operator+= (object< T, N, S2 > const &) |
Add a vector. | |
template<typename S2 > | |
object & | operator-= (object< T, N, S2 > const &) |
Subtract a vector. | |
template<typename S2 > | |
object & | operator*= (object< T, N, S2 > const &) |
Multiply by a vector. | |
object & | operator*= (value_type const &) |
Multiply a vector by a scalar. | |
const_reference | get_unsafe (size_type) const |
Returns a reference to the vector element at a specified position. | |
reference | get_unsafe (size_type) |
Returns a reference to the vector element at a specified position. | |
reference | x () |
Returns a reference to the first element in the vector. | |
const_reference | x () const |
Returns a reference to the first element in the vector. | |
reference | y () |
Returns a reference to the second element in the vector. | |
const_reference | y () const |
Returns a reference to the second element in the vector. | |
reference | z () |
Returns a reference to the third element in the vector. | |
const_reference | z () const |
Returns a reference to the third element in the vector. | |
reference | w () |
Returns a reference to the fourth element in the vector. | |
const_reference | w () const |
Returns a reference to the fourth element in the vector. | |
S & | storage () |
S const & | storage () const |
using fcppt::math::vector::object< T, N, S >::const_reference = typename storage_type::const_reference |
A type that provides a reference to a const
element stored in a vector for reading and performing const
operations.
using fcppt::math::vector::object< T, N, S >::difference_type = fcppt::math::difference_type |
A type that provides the difference between the addresses of two elements in a vector.
using fcppt::math::vector::object< T, N, S >::dim_wrapper = fcppt::math::static_size<N> |
A typedef for the N
parameter.
using fcppt::math::vector::object< T, N, S >::reference = typename storage_type::reference |
A type that provides a reference to an element stored in a vector.
using fcppt::math::vector::object< T, N, S >::size_type = fcppt::math::size_type |
A type that counts the number of elements in a vector.
using fcppt::math::vector::object< T, N, S >::static_size = dim_wrapper |
The static size.
using fcppt::math::vector::object< T, N, S >::storage_type = S |
A typedef for the S
parameter.
using fcppt::math::vector::object< T, N, S >::value_type = T |
A type that represents the data type stored in a vector.
|
explicit |
Construct an uninitialized vector.
|
explicit |
Construct a vector from a storage source.
|
explicitconstexprnoexcept |
|
explicit |
Create a vector from a vector with the same dimension and value type but different storage type.
OtherStorage | The other vector's storage type |
|
nodiscard |
Returns a reference to the vector element at a specified position.
|
nodiscard |
Returns a reference to the vector element at a specified position.
object & fcppt::math::vector::object< T, N, S >::operator*= | ( | object< T, N, S2 > const & | ) |
Multiply by a vector.
object & fcppt::math::vector::object< T, N, S >::operator*= | ( | value_type const & | ) |
Multiply a vector by a scalar.
object & fcppt::math::vector::object< T, N, S >::operator+= | ( | object< T, N, S2 > const & | ) |
Add a vector.
object & fcppt::math::vector::object< T, N, S >::operator-= | ( | object< T, N, S2 > const & | ) |
Subtract a vector.
object & fcppt::math::vector::object< T, N, S >::operator= | ( | fcppt::math::vector::object< T, N, OtherStorage > const & | ) |
Copy the values from a different vector.
OtherStorage | The other vector's storage type |
|
nodiscard |
|
nodiscard |
|
nodiscard |
Returns a reference to the fourth element in the vector.
|
nodiscard |
Returns a reference to the fourth element in the vector.
|
nodiscard |
Returns a reference to the first element in the vector.
|
nodiscard |
Returns a reference to the first element in the vector.
|
nodiscard |
Returns a reference to the second element in the vector.
|
nodiscard |
Returns a reference to the second element in the vector.
|
nodiscard |
Returns a reference to the third element in the vector.
|
nodiscard |
Returns a reference to the third element in the vector.