-
- Downloads
libstdc++: Use RAII types in strtod-based std::from_chars implementation
This adds auto_locale and auto_ferounding types to use RAII for changing
and restoring the local and floating-point environment when using strtod
to implement std::from_chars.
The destructors for the RAII objects run slightly later than the
previous statements that restored the locale/fenv, but the differences
are just some trivial assignments and an isinf call.
Reviewed-by:
Patrick Palka <ppalka@redhat.com>
libstdc++-v3/ChangeLog:
* src/c++17/floating_from_chars.cc [USE_STRTOD_FOR_FROM_CHARS]
(auto_locale, auto_ferounding): New class types.
(from_chars_impl): Use auto_locale and auto_ferounding.
Loading
Please register or sign in to comment