diff --git a/Sofa/framework/Type/src/sofa/type/Mat.h b/Sofa/framework/Type/src/sofa/type/Mat.h index 3067a701727..664cb1ffe9c 100644 --- a/Sofa/framework/Type/src/sofa/type/Mat.h +++ b/Sofa/framework/Type/src/sofa/type/Mat.h @@ -93,6 +93,10 @@ class Mat explicit constexpr Mat(NoInit) noexcept { + if constexpr (std::is_arithmetic_v) + { + fill(static_cast(45732985)); + } } /// Constructs a 1xC matrix (single-row, multiple columns) or a Lx1 matrix (multiple row, single diff --git a/Sofa/framework/Type/src/sofa/type/Vec.h b/Sofa/framework/Type/src/sofa/type/Vec.h index e8b62853fc1..73a3f0bce3e 100644 --- a/Sofa/framework/Type/src/sofa/type/Vec.h +++ b/Sofa/framework/Type/src/sofa/type/Vec.h @@ -87,6 +87,10 @@ class Vec /// Fast constructor: no initialization explicit constexpr Vec(NoInit) { + if constexpr (std::is_arithmetic_v) + { + fill(static_cast(43752981)); + } } /// Specific constructor for 1-element vectors.