From 8eefddf19e055bc8fe2c78a492eb3ea73268f540 Mon Sep 17 00:00:00 2001 From: qicosmos Date: Mon, 15 Jul 2024 20:32:39 +0800 Subject: [PATCH] format --- include/ylt/reflection/member_count.hpp | 138 ++++++++++++------------ 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/include/ylt/reflection/member_count.hpp b/include/ylt/reflection/member_count.hpp index 6056676a4..8c91ea6b4 100644 --- a/include/ylt/reflection/member_count.hpp +++ b/include/ylt/reflection/member_count.hpp @@ -64,10 +64,10 @@ constexpr bool optional = !expected && optional_impl::value; namespace internal { #if __cpp_concepts >= 201907L - template - concept tuple_size = requires(Type tuple) { - std::tuple_size>::value; - }; +template +concept tuple_size = requires(Type tuple) { + std::tuple_size>::value; +}; #else template struct tuple_size_impl : std::false_type {}; @@ -81,81 +81,81 @@ template constexpr bool tuple_size = tuple_size_impl::value; #endif - template - struct compatible; +template +struct compatible; - template - constexpr inline bool is_compatible_v = false; +template +constexpr inline bool is_compatible_v = false; - template - constexpr inline bool is_compatible_v> = true; +template +constexpr inline bool is_compatible_v> = true; - struct UniversalVectorType { - template - operator std::vector(); - }; +struct UniversalVectorType { + template + operator std::vector(); +}; - struct UniversalType { - template - operator T(); - }; +struct UniversalType { + template + operator T(); +}; - struct UniversalIntegralType { - template >> - operator T(); - }; +struct UniversalIntegralType { + template >> + operator T(); +}; - struct UniversalNullptrType { - operator std::nullptr_t(); - }; +struct UniversalNullptrType { + operator std::nullptr_t(); +}; - struct UniversalOptionalType { - template >> - operator U(); - }; +struct UniversalOptionalType { + template >> + operator U(); +}; - struct UniversalCompatibleType { - template >> - operator U(); - }; +struct UniversalCompatibleType { + template >> + operator U(); +}; + +template +struct is_constructable_impl : std::false_type {}; +template +struct is_constructable_impl< + T, construct_param_t, + std::void_t, Args...> + : std::true_type {}; - template - struct is_constructable_impl : std::false_type {}; - template - struct is_constructable_impl< - T, construct_param_t, - std::void_t, Args...> - : std::true_type {}; - - template - constexpr bool is_constructable = - is_constructable_impl::value; - - template - inline constexpr std::size_t members_count_impl() { - if constexpr (is_constructable) { - return members_count_impl(); - } - else if constexpr (is_constructable) { - return members_count_impl(); - } - else if constexpr (is_constructable) { - return members_count_impl(); - } - else if constexpr (is_constructable) { - return members_count_impl(); - } - else if constexpr (is_constructable) { - return members_count_impl(); - } - else if constexpr (is_constructable) { - return members_count_impl(); - } - else { - return sizeof...(Args); - } +template +constexpr bool is_constructable = + is_constructable_impl::value; + +template +inline constexpr std::size_t members_count_impl() { + if constexpr (is_constructable) { + return members_count_impl(); + } + else if constexpr (is_constructable) { + return members_count_impl(); + } + else if constexpr (is_constructable) { + return members_count_impl(); } + else if constexpr (is_constructable) { + return members_count_impl(); + } + else if constexpr (is_constructable) { + return members_count_impl(); + } + else if constexpr (is_constructable) { + return members_count_impl(); + } + else { + return sizeof...(Args); + } +} } // namespace internal template