[libcxx-commits] [PATCH] D70631: Microsoft's floating-point to_chars powered by Ryu and Ryu Printf

Stephan T. Lavavej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 4 19:03:39 PST 2020

STL_MSFT marked an inline comment as done.
STL_MSFT added inline comments.

Comment at: libcxx/include/charconv:733
+    if constexpr (_IsSame<_Floating, float>::value) {
+        _Adjusted_mantissa = _Ieee_mantissa << 1; // align to hexit boundary (23 isn't divisible by 4)
ivafanas wrote:
> As I remember `if constexpr` is available since C++17:
> https://en.cppreference.com/w/cpp/language/if
> And `charconv` header was made usable with C++11 in libc++:
> https://reviews.llvm.org/D59598
> May be it is a good idea to save header compatibility with C++11.
MSVC and Clang actually support `if constexpr` in earlier language versions (I am not sure about C++11 since MSVC supports only C++14), with a warning that can be suppressed.

I don't understand why someone would want to use an old language mode with a new library mode, but this shouldn't be a blocking issue for that.



More information about the libcxx-commits mailing list