[#absl-SimpleHexAtoi-0a2]
= xref:absl.adoc[absl]::SimpleHexAtoi
:relfileprefix: ../
:mrdocs:

Converts a hexadecimal string to an integer, returning `true` if successful&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;numbers&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename int&lowbar;type&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
bool
SimpleHexAtoi(
    std::string&lowbar;view str,
    int&lowbar;type* out);
----

== Description

The string (optionally followed or preceded by ASCII whitespace) must be a valid base&hyphen;16 hexadecimal integer whose value falls within the range of the integer type (optionally preceded by a `&plus;` or `&hyphen;`)&period; A valid hexadecimal value may include both upper and lowercase character symbols, and may optionally include a leading &quot;0x&quot; (or &quot;0X&quot;) number prefix, which is ignored by this function&period; If any errors are encountered, this function returns `false`, leaving `out` in an unspecified state&period;

== Return Value

`true` on success&semi; otherwise `false`&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| The string to parse&period;
| *out*
| The location that receives the parsed value&period;
|===


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