From 9a426c8313877a6a8a3cd31104494ee5a1508ddd Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Thu, 9 Jan 2025 12:42:12 +0100 Subject: [PATCH] [Type] Convert enable_if to concepts in fixed_array --- Sofa/framework/Type/src/sofa/type/fixed_array.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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