Skip to content

Commit

Permalink
Refactoring: Improve code clarity (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingxwa authored Jun 6, 2024
1 parent e60902c commit a955654
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,12 @@ using composite_accessor = recursive_reduction_t<accessor_helper<proxy<F>>

template <class F>
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<const proxiable_ptr_constraints&>; }) {
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;
}
Expand Down Expand Up @@ -437,7 +440,6 @@ template <class F>
requires {
typename F::convention_types;
typename F::reflection_types;
{ F::constraints } -> std::same_as<const proxiable_ptr_constraints&>;
} && is_tuple_like_well_formed<typename F::convention_types>() &&
is_tuple_like_well_formed<typename F::reflection_types>() &&
is_facade_constraints_well_formed<F>() &&
Expand Down

0 comments on commit a955654

Please sign in to comment.