From 64a68590fd3e41826351003ee9b03f53d25f0aa2 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Sun, 18 Jan 2026 19:05:51 -0500 Subject: [PATCH] Clarify `std::from_chars` conversion method Updated explanation of `std::from_chars` conversion checks. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d19283f..71a892d 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ int main() { } ``` -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: +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: ```cpp #include "fast_float/fast_float.h"