Skip to content

[Refactoring] Check static properties with a single probe template - #78

Merged
mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/prop-probe
Sep 10, 2026
Merged

[Refactoring] Check static properties with a single probe template#78
mingxwa merged 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/prop-probe

Conversation

@mingxwa

@mingxwa mingxwa commented Sep 7, 2026

Copy link
Copy Markdown
Member

Replaced is_consteval and the static_prop concept with static_prop_probe<T, V>, which answers in one requirement what previously took two sequential checks. Passing X::member as an auto non-type argument already demands a constant expression, and is_same_v<T, decltype(V)> pins the type exactly, since auto deduction drops the const that an implicit conversion would otherwise hide.

No functional changes.

`is_consteval` and the `static_prop` concept split one question into two
checks that every call site had to run in sequence, once to confirm the
member had the exact declared type and again to confirm its value was a
constant expression.

`static_prop_probe<T, V>` answers both at once. Passing `X::member` as an
`auto` non-type argument already requires a constant expression, and
`is_same_v<T, decltype(V)>` pins the type exactly, since `auto` deduction
drops the `const` that an implicit conversion would otherwise hide.

Each call site loses a nested `if constexpr`. `is_is_direct_well_formed`
reduced to a single requirement and folded into the `requires` blocks of
`basic_convention` and `basic_reflection`, its only two callers.
@mingxwa
mingxwa merged commit f65a24c into ngcpp:feature/v5 Sep 10, 2026
18 checks passed
@mingxwa
mingxwa deleted the user/mingxwa/prop-probe branch September 10, 2026 22:55
mingxwa added a commit to mingxwa/proxy that referenced this pull request Sep 11, 2026
Resolved the conflict in core.h after extended_overload. This branch had
moved diagnose_proxiable_required_convention_not_implemented down next to
facade_traits, and ngcpp#78 removed is_is_direct_well_formed now that
static_prop_probe checks is_direct inside the concepts. Neither belongs at
that spot any more.

ngcpp#76 removed the converting constructors of the meta storages. The
converting constructors of proxy only assign meta_, which ngcpp#76 kept and
extended to an inline storage assigned from a static one, so no further
change is needed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mingxwa added a commit to mingxwa/proxy that referenced this pull request Sep 11, 2026
Resolved the conflict in core.h after extended_overload. This branch had
moved diagnose_proxiable_required_convention_not_implemented down next to
facade_traits, and ngcpp#78 removed is_is_direct_well_formed now that
static_prop_probe checks is_direct inside the concepts. Neither belongs at
that spot any more.

ngcpp#76 removed the converting constructors of the meta storages. The
converting constructors of proxy only assign meta_, which ngcpp#76 kept and
extended to an inline storage assigned from a static one, so no further
change is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants