summaryrefslogtreecommitdiff
path: root/indra/llmath/v4math.h
diff options
context:
space:
mode:
authorRye <rye@lindenlab.com>2025-02-02 03:40:21 -0500
committerRye <rye@lindenlab.com>2025-02-11 05:04:05 -0500
commit39a13e4088db6e4023d196de07765363ddce2c4f (patch)
tree612417d310bd8796424d34dc43a03ebdc9e39541 /indra/llmath/v4math.h
parent6fcd349f374710a3f4e0e0585bb6d7af86ebb66d (diff)
Restore math types to trivially copyable and add static asserts
Diffstat (limited to 'indra/llmath/v4math.h')
-rw-r--r--indra/llmath/v4math.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h
index a4c9668fdd..f5b79759b0 100644
--- a/indra/llmath/v4math.h
+++ b/indra/llmath/v4math.h
@@ -146,6 +146,10 @@ class LLVector4
friend LLVector4 operator-(const LLVector4 &a); // Return vector -a
};
+static_assert(std::is_trivially_copyable<LLVector4>::value, "LLVector4 must be trivial copy");
+static_assert(std::is_trivially_move_assignable<LLVector4>::value, "LLVector4 must be trivial move");
+static_assert(std::is_standard_layout<LLVector4>::value, "LLVector4 must be a standard layout type");
+
// Non-member functions
F32 angle_between(const LLVector4 &a, const LLVector4 &b); // Returns angle (radians) between a and b
bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon = F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel