OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::detail Namespace Reference

Functions

locale_t c_locale () noexcept
 Process-wide "C" locale handle for strtod_l.
 

Function Documentation

◆ c_locale()

locale_t openswmm::detail::c_locale ( )
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.

Here is the caller graph for this function: