-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement P2291R3 constexpr
Integral <charconv>
#3049
Implement P2291R3 constexpr
Integral <charconv>
#3049
Conversation
😈 Should we increase the limit? |
Unfortunately clang-cl does not recognize that option 🙁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment nitpick that I'll apply.
Thanks, this looks great! 😻 I pushed small changes for an unnecessary cast and tiny style improvements (FYI @CaseyCarter @strega-nil-ms). The test's use of internal machinery ( |
@@ -197,9 +197,11 @@ void test_common_to_chars( | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can avoid using internal mechanisms in test file by replacing them with the following... (no change requested)
#if _HAS_CXX23 // testing constexpr overloads for integral types in C++23 (P2291R3) | |
#define CONSTEXPR23 constexpr | |
constexpr is_runtime_evaluated() noexcept { | |
return !is_constant_evaluated(); | |
} | |
#else // ^^^ _HAS_CXX23 / vvv !_HAS_CXX23 | |
#define CONSTEXPR23 inline | |
constexpr is_runtime_evaluated() noexcept { | |
return true; | |
} | |
#endif // _HAS_CXX23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could do something like that in the future, possibly centralized in a lightweight classic header.
For the time being, tests don't need to strenuously avoid internal machinery and macros as long as there is reasonable justification.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for making |
Fixes #2920.