mirror of
https://github.com/BlackMATov/vmath.hpp.git
synced 2025-12-16 22:19:51 +07:00
data function for vector and matrix
This commit is contained in:
@@ -204,10 +204,18 @@ namespace vmath_hpp
|
||||
void swap(mat& other) noexcept(std::is_nothrow_swappable_v<T>) {
|
||||
for ( std::size_t i = 0; i < Size; ++i ) {
|
||||
using std::swap;
|
||||
swap((*this)[i], other[i]);
|
||||
swap(rows[i], other.rows[i]);
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr pointer data() noexcept {
|
||||
return &rows[0];
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr const_pointer data() const noexcept {
|
||||
return &rows[0];
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr reference operator[](std::size_t index) noexcept {
|
||||
return rows[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user