[#mp_units-utility-parse_nonnegative_int] = xref:mp_units.adoc[mp_units]::xref:mp_units/utility.adoc[utility]::parse_nonnegative_int :relfileprefix: ../../ :mrdocs: Parses the range [begin, end) as an unsigned integer.] == Synopsis Declared in `<mp‐units/utility/format.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<std::forward_iterator It> [[nodiscard]] constexpr int parse_nonnegative_int( It& begin, It end, int error_value); ---- == Description The range must be non‐empty and start with a digit. == Return Value the parsed integer, or `error_value` on overflow [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *begin* | the beginning of the range to parse; advanced past the parsed digits | *end* | the end of the range to parse | *error_value* | the value to return if the parsed integer overflows `int` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#