diff --git a/Sofa/framework/Type/src/sofa/type/fixed_array.h b/Sofa/framework/Type/src/sofa/type/fixed_array.h index ec1e711ca9d..edbffaa367d 100644 --- a/Sofa/framework/Type/src/sofa/type/fixed_array.h +++ b/Sofa/framework/Type/src/sofa/type/fixed_array.h @@ -83,18 +83,16 @@ class fixed_array constexpr fixed_array() {} /// Specific constructor for 1-element vectors. - template::type = 0> explicit constexpr fixed_array(value_type r1) noexcept + requires (N == 1) { elems[0] = r1; } - template && ...) >, - typename = std::enable_if_t< (sizeof...(ArgsT) == N && sizeof...(ArgsT) > 1) > - > + template constexpr fixed_array(ArgsT&&... r) noexcept - : elems{static_cast(std::forward< ArgsT >(r))...} + requires ((std::convertible_to && ...) && sizeof...(ArgsT) == N && sizeof...(ArgsT) > 1) + : elems{static_cast(std::forward(r))...} {} // iterator support