aboutsummaryrefslogtreecommitdiffstats
path: root/common/vecmat.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-08 04:33:32 -0800
committerChris Robinson <[email protected]>2023-12-08 04:33:32 -0800
commit8f661a2f59e63cbed540b512dc564a3aca7c4211 (patch)
tree8c8fbd2be037eaaf254feabe061642bea96c4bd2 /common/vecmat.h
parent5b5b948516f7340810ebbfdd5e46eb40f85d2e56 (diff)
Fix some clang-tidy warnings
Diffstat (limited to 'common/vecmat.h')
-rw-r--r--common/vecmat.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/vecmat.h b/common/vecmat.h
index a45f262f..0cdb82eb 100644
--- a/common/vecmat.h
+++ b/common/vecmat.h
@@ -14,7 +14,7 @@ namespace alu {
template<typename T>
class VectorR {
static_assert(std::is_floating_point<T>::value, "Must use floating-point types");
- alignas(16) T mVals[4];
+ alignas(16) std::array<T,4> mVals;
public:
constexpr VectorR() noexcept = default;
@@ -58,7 +58,7 @@ public:
return T{0};
}
- constexpr VectorR cross_product(const alu::VectorR<T> &rhs) const noexcept
+ [[nodiscard]] constexpr auto cross_product(const alu::VectorR<T> &rhs) const noexcept -> VectorR
{
return VectorR{
mVals[1]*rhs.mVals[2] - mVals[2]*rhs.mVals[1],
@@ -67,7 +67,7 @@ public:
T{0}};
}
- constexpr T dot_product(const alu::VectorR<T> &rhs) const noexcept
+ [[nodiscard]] constexpr auto dot_product(const alu::VectorR<T> &rhs) const noexcept -> T
{ return mVals[0]*rhs.mVals[0] + mVals[1]*rhs.mVals[1] + mVals[2]*rhs.mVals[2]; }
};
using Vector = VectorR<float>;
@@ -75,7 +75,7 @@ using Vector = VectorR<float>;
template<typename T>
class MatrixR {
static_assert(std::is_floating_point<T>::value, "Must use floating-point types");
- alignas(16) T mVals[16];
+ alignas(16) std::array<T,16> mVals;
public:
constexpr MatrixR() noexcept = default;