Skip to content

Commit 64a6859

Browse files
authored
Clarify std::from_chars conversion method
Updated explanation of `std::from_chars` conversion checks.
1 parent cffb71d commit 64a6859

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int main() {
6969
}
7070
```
7171

72-
Though the C++17 standard has you do a comparison with `std::errc()` to check whether the conversion worked, you can avoid it by casting the result to a `bool` like so:
72+
Prior to C++26, checking for a successful `std::from_chars` conversion requires comparing the `from_chars_result::ec` member to `std::errc()`. As an extension `fast_float::from_chars` supports the improved C++26 API that allows checking the result by converting it to `bool`, like so:
7373

7474
```cpp
7575
#include "fast_float/fast_float.h"

0 commit comments

Comments
 (0)