diff --git a/types/description.hpp b/types/description.hpp index 7292332d..874cd1b7 100644 --- a/types/description.hpp +++ b/types/description.hpp @@ -73,6 +73,10 @@ namespace cruft::types { /// A description of the type that makes up a scalar or vector type. /// /// A vector3f would be { REAL, sizeof(float), 3 }; + /// + /// DO NOT add a 'size' member function as it tends to be used in a way + /// that confuses total byte size, element byte size, and arity. + /// Instead: use the bytes member function, or the arity member variable. struct description { /// The signed, realness, or voidness of the type. enum category category; @@ -86,7 +90,11 @@ namespace cruft::types { std::size_t alignment; /// Returns the number of bytes required to store this type. - constexpr std::size_t size (void) const noexcept { return width * arity; } + constexpr std::size_t + bytes (void) const noexcept + { + return width * arity; + } };