diff --git a/src/Magnum/Math/Packing.h b/src/Magnum/Math/Packing.h index e66426f2f..69c1b870e 100644 --- a/src/Magnum/Math/Packing.h +++ b/src/Magnum/Math/Packing.h @@ -94,6 +94,8 @@ template()), FloatingPoint(-1.0)); } template FloatingPoint unpack(const Vector& value) { + static_assert(FloatingPoint::Size == size, + "return vector type should have the same size as input vector type"); FloatingPoint out{NoInit}; for(std::size_t i = 0; i != size; ++i) out[i] = unpack(value[i]); @@ -150,6 +152,8 @@ template()); } template Integral pack(const Vector& value) { + static_assert(Integral::Size == size, + "return vector type should have the same size as input vector type"); Integral out{NoInit}; for(std::size_t i = 0; i != size; ++i) out[i] = pack(value[i]);