Browse Source

Adding some static_assert

Panagiotis Christopoulos Charitos 13 years ago
parent
commit
5d7d1ebc23

+ 2 - 0
include/anki/math/Mat3.h

@@ -127,6 +127,8 @@ private:
 };
 /// @}
 
+static_assert(sizeof(Mat3) == sizeof(float) * 3 * 3, "Incorrect size");
+
 } // end namespace
 
 #include "anki/math/Mat3.inl.h"

+ 2 - 0
include/anki/math/Mat4.h

@@ -134,6 +134,8 @@ private:
 };
 /// @}
 
+static_assert(sizeof(Mat4) == sizeof(float) * 4 * 4, "Incorrect size");
+
 } // end namespace
 
 #include "anki/math/Mat4.inl.h"

+ 3 - 1
include/anki/math/Vec2.h

@@ -95,7 +95,9 @@ private:
 	};
 	/// @}
 };
-/// @}
+/// @
+
+static_assert(sizeof(Vec2) == sizeof(float) * 2, "Incorrect size");
 
 } // end namespace
 

+ 2 - 0
include/anki/math/Vec3.h

@@ -135,6 +135,8 @@ private:
 };
 /// @}
 
+static_assert(sizeof(Vec3) == sizeof(float) * 3, "Incorrect size");
+
 } // end namespace
 
 #include "anki/math/Vec3.inl.h"

+ 2 - 0
include/anki/math/Vec4.h

@@ -120,6 +120,8 @@ private:
 };
 /// @}
 
+static_assert(sizeof(Vec4) == sizeof(float) * 4, "Incorrect size");
+
 } // end namespace
 
 #include "anki/math/Vec4.inl.h"