Skip to content

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

Open
mingxwa wants to merge 1 commit into
ngcpp:feature/v5from
mingxwa:user/mingxwa/prop-probe
Open

[Refactoring] Check static properties with a single probe template#78
mingxwa wants to merge 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.
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.

1 participant