35template <
typename T, std::
size_t N>
42 template <
typename...
Coords>
44 requires(
sizeof...(coords) == N)
45 : coordinates{
coords...} {}
48 constexpr Vector() : coordinates{} {}
51 constexpr auto begin()
const {
return coordinates.begin(); }
54 constexpr auto end()
const {
return coordinates.end(); }
62 AK_ASSERT(
idx < N &&
"Vector const access index out of bounds");
63 return coordinates[
idx];
72 AK_ASSERT(
idx < N &&
"Vector mutable access index out of bounds");
73 return coordinates[
idx];
81 return is_equal(
other);
89 return !is_equal(
other);
95 constexpr auto view() {
return std::span<T, N>{coordinates}; }
98 constexpr auto size()
const {
return N; }
102 constexpr bool is_equal(
const Vector&
other)
const {
103 for (std::size_t
i = 0;
i < N; ++
i)
104 if (
other.coordinates[
i] != coordinates[
i])
return false;
108 std::array<T, N> coordinates;
118template <
typename T,
typename...
Ts>
constexpr std::size_t mat_rows_v
Registered compile-time row count after cv/ref normalization.
Owning, fixed-size vector container.
constexpr auto begin() const
Const iterator to the first coordinate.
constexpr auto end() const
Const iterator one past the final coordinate.
constexpr Vector()
Construct a value-initialized vector.
constexpr auto view()
Obtain a mutable fixed-extent view of contiguous coordinate storage.
constexpr T & operator()(std::size_t idx)
Read or modify a coordinate at a zero-based index.
constexpr bool operator==(const Vector &other) const
Compare coordinates for exact element-wise equality.
constexpr bool operator!=(const Vector &other) const
Compare coordinates for element-wise inequality.
constexpr auto size() const
Return the compile-time coordinate count N.
constexpr const T & operator()(std::size_t idx) const
Read a coordinate at a zero-based index.
constexpr Vector(Coords... coords)
Construct from exactly N coordinate values.