[#LocaleIndependentAtoi]
= LocaleIndependentAtoi
:mrdocs:

Locale&hyphen;independent replacement for std&colon;&colon;atoi, provided for backwards compatibility reasons&period;

== Synopsis

Declared in `&lt;util&sol;strencodings&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename T&gt;
T
LocaleIndependentAtoi(std::string&lowbar;view str);
----

== Description

New code should use ToIntegral&period;

The goal of LocaleIndependentAtoi is to replicate the defined behaviour of std&colon;&colon;atoi as it behaves under the &quot;C&quot; locale, and remove some undefined behavior&period; If the parsed value is bigger than the integer type&apos;s maximum value, or smaller than the integer type&apos;s minimum value, std&colon;&colon;atoi has undefined behavior, while this function returns the maximum or minimum values, respectively&period;

== Return Value

The parsed integer, saturated to the range of T on overflow, or 0 if str is not parsable&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| The string to parse&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
