![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Functions | |
| locale_t | c_locale () noexcept |
| Process-wide "C" locale handle for strtod_l. | |
|
inlinenoexcept |
Process-wide "C" locale handle for strtod_l.
Plain strtod consults the current global locale on every call to find the decimal separator. Pinning the C locale removes that work and, more importantly, makes the conversion locale-independent — which is what std::from_chars guarantees on the platforms that take the other branch. Without it a host running under a comma-decimal locale would parse "0.013" as 0.
Constructed once on first use. If newlocale() fails the handle is null and the call sites fall back to plain strtod.