Implement P2291R3 constexpr Integral <charconv> - #3049
Implement P2291R3 constexpr Integral <charconv>#3049Stephan T. Lavavej (StephanTLavavej) merged 9 commits into
constexpr Integral <charconv>#3049Conversation
😈 Should we increase the limit? |
Unfortunately clang-cl does not recognize that option 🙁 |
Casey Carter (CaseyCarter)
left a comment
There was a problem hiding this comment.
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 Casey Carter (@CaseyCarter) nicole mazzuca (@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.
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.
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.