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