Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES.30 fix example code #2143

Merged
merged 2 commits into from
Oct 12, 2023
Merged

ES.30 fix example code #2143

merged 2 commits into from
Oct 12, 2023

Conversation

SpeedReach
Copy link
Contributor

The example should be passing in a constexpr and validating it at compile time like a macro, but instead passes a unknown value at compile time. Which may cause mislead and the code doesn't even work.

Ref: #2136

The example should be passing in a constexpr and validating it at compile time like a macro, but instead passes a unknown value at compile time. Which may cause mislead and the code doesn't even work.

Ref: isocpp#2136
@hsutter
Copy link
Contributor

hsutter commented Oct 12, 2023

Editors call: We agree the example is incorrect and want to adjust the proposed solution.

@SpeedReach
Copy link
Contributor Author

Let me know if there's any change needed in the pull request, thanks!

@cubbimew
Copy link
Member

I think the main reaction was that use of numbers made it harder to quickly grasp and the out-of-range constant was distracting, how about make it go like this:

        string s1 = stringify<a>(); 
        string s2 = stringify<b>(); 

Used enums instead of raw numbers.
@SpeedReach
Copy link
Contributor Author

Sure! The change is done in the latest commit.

@cubbimew cubbimew merged commit 1bdb43e into isocpp:master Oct 12, 2023
1 check passed
@cubbimew
Copy link
Member

thanks. lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants