[#LocaleIndependentAtoi] = LocaleIndependentAtoi :mrdocs: Locale‐independent replacement for std::atoi, provided for backwards compatibility reasons. == Synopsis Declared in `<util/strencodings.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> T LocaleIndependentAtoi(std::string_view str); ---- == Description New code should use ToIntegral. The goal of LocaleIndependentAtoi is to replicate the defined behaviour of std::atoi as it behaves under the "C" locale, and remove some undefined behavior. If the parsed value is bigger than the integer type's maximum value, or smaller than the integer type's minimum value, std::atoi has undefined behavior, while this function returns the maximum or minimum values, respectively. == Return Value The parsed integer, saturated to the range of T on overflow, or 0 if str is not parsable. == Parameters [cols="1,4"] |=== | Name| Description | *str* | The string to parse. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#