From a9556544d4d113abe56cb7cd2153486dfa41d7b8 Mon Sep 17 00:00:00 2001 From: Mingxin Wang Date: Thu, 6 Jun 2024 14:41:01 +0800 Subject: [PATCH] Refactoring: Improve code clarity (#112) --- proxy.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/proxy.h b/proxy.h index 7c0fee2..c5921b8 100644 --- a/proxy.h +++ b/proxy.h @@ -383,9 +383,12 @@ using composite_accessor = recursive_reduction_t> template consteval bool is_facade_constraints_well_formed() { - if constexpr (is_consteval([] { return F::constraints; })) { - return std::has_single_bit(F::constraints.max_align) && - F::constraints.max_size % F::constraints.max_align == 0u; + if constexpr (requires { + { F::constraints } -> std::same_as; }) { + if constexpr (is_consteval([] { return F::constraints; })) { + return std::has_single_bit(F::constraints.max_align) && + F::constraints.max_size % F::constraints.max_align == 0u; + } } return false; } @@ -437,7 +440,6 @@ template requires { typename F::convention_types; typename F::reflection_types; - { F::constraints } -> std::same_as; } && is_tuple_like_well_formed() && is_tuple_like_well_formed() && is_facade_constraints_well_formed() &&