Parses the range [begin, end) as an unsigned integer.]

Synopsis

Declared in <mp‐units/utility/format.h>

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 should not be discarded.

Parameters

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

Created with MrDocs