From 7c00b196a3056c353bc5b3e3d000bf2d9ef50484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Mon, 7 Sep 2020 01:14:14 -0400 Subject: [PATCH] refactor: simplify is_derived_from_specialization_of --- src/include/units/bits/external/type_traits.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/include/units/bits/external/type_traits.h b/src/include/units/bits/external/type_traits.h index 226be77b..34b4ddda 100644 --- a/src/include/units/bits/external/type_traits.h +++ b/src/include/units/bits/external/type_traits.h @@ -68,16 +68,12 @@ inline constexpr bool is_specialization_of, Type> = true; // is_derived_from_specialization_of namespace detail { -template typename Type> -struct is_derived_from_specialization_of_impl { - template - static constexpr std::true_type check_base(const Type&); - static constexpr std::false_type check_base(...); -}; +template typename Type, typename... Params> +void to_base_specialization_of(const volatile Type*); } // namespace detail template typename Type> -inline constexpr bool is_derived_from_specialization_of = decltype(detail::is_derived_from_specialization_of_impl::check_base(std::declval()))::value; +concept is_derived_from_specialization_of = requires { detail::to_base_specialization_of(std::declval()); }; } // namespace units