Skip to content
Snippets Groups Projects
Commit bd026695 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

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: default avatarPatrick 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.
parent aa39ed44
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment