From 3e31067ce4f3a29f204ecda2fe0a165ec9bfd08a Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 10 Sep 2024 18:48:11 +0200 Subject: [PATCH] refactor: `has_common_type_v` simplified --- src/core/include/mp-units/bits/sudo_cast.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/core/include/mp-units/bits/sudo_cast.h b/src/core/include/mp-units/bits/sudo_cast.h index 137c9d30..845761b6 100644 --- a/src/core/include/mp-units/bits/sudo_cast.h +++ b/src/core/include/mp-units/bits/sudo_cast.h @@ -30,17 +30,8 @@ namespace mp_units::detail { -template -struct has_common_type_impl : std::false_type {}; - template -struct has_common_type_impl>, Ts...> : std::true_type {}; - -template -using has_common_type = typename has_common_type_impl::type; - -template -constexpr bool has_common_type_v = has_common_type_impl::value; +constexpr bool has_common_type_v = requires { typename std::common_type_t; }; template using maybe_common_type =