[Refactoring] Check static properties with a single probe template - #78
Merged
Merged
Conversation
`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.
tian-lt-personal
approved these changes
Sep 10, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced
is_constevaland thestatic_propconcept withstatic_prop_probe<T, V>, which answers in one requirement what previously took two sequential checks. PassingX::memberas an auto non-type argument already demands a constant expression, andis_same_v<T, decltype(V)>pins the type exactly, sinceautodeduction drops theconstthat an implicit conversion would otherwise hide.No functional changes.