[libcxx-commits] [libcxx] [libc++] LWG2381: Inconsistency in parsing floating point numbers (PR #77948)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Apr 7 04:42:34 PDT 2024
================
@@ -366,9 +366,11 @@ _LIBCPP_HIDE_FROM_ABI _ForwardIterator __scan_keyword(
struct _LIBCPP_EXPORTED_FROM_ABI __num_get_base {
static const int __num_get_buf_sz = 40;
+ static const size_t __int_chr_cnt = 26; // count of leading characters in __src used for parsing integers
+ static const size_t __fp_chr_cnt = 28; // count of leading characters in __src used for parsing floating-point values
----------------
mordante wrote:
I would move these down, directly below `static const char __src[33]; // "0123456789abcdefABCDEFxX+-pPiInN"`
```suggestion
static const size_t __int_chr_cnt = 26; // count of leading characters in __src used for parsing integers ("012..X+-")
static const size_t __fp_chr_cnt = 28; // count of leading characters in __src used for parsing floating-point values ("012..-pP")
```
I think adding a range makes it easier to understand which characters are in the range.
https://github.com/llvm/llvm-project/pull/77948
More information about the libcxx-commits
mailing list