The int_parser can parse
signed integers of arbitrary length and size. This is almost the same
as the uint_parser. The
only difference is the additional task of parsing the '+'
or '-' sign preceding the number.
The class interface is the same as that of the uint_parser.

The int_parser parser
can be used to parse ordinary primitive C/C++ integers or even user defined
scalars such as bigints (unlimited precision integers) as long as the
type follows certain expression requirements (documented below).

Semantics of an expression is defined only where it differs from, or
is not defined in PrimitiveParser.

Expression

Semantics

short_int_long_long_long

Parse a signed integer using the default radix (10).

lit(num)short_(num)int_(num)long_(num)long_long(num)

Match the literal num
using the default radix (10). The parser will fail if the parsed
value is not equal to the specified value.

int_parser<T,Radix,MinDigits,MaxDigits>()

Parse a signed integer of type T
using radix Radix,
with a minimum of MinDigits
and a maximum of MaxDigits.

int_parser<T,Radix,MinDigits,MaxDigits>()(num)

Match the literal num
of type T using
radix Radix,
with a minimum of MinDigits
and a maximum of MaxDigits.
The parser will fail if the parsed value is not equal to the
specified value.

Important

All numeric parsers check for overflow conditions based on the type
T the corresponding
int_parser<>
has been instantiated with. If the parsed number overflows this type
the parsing fails. Please be aware that the overflow check is not based
on the type of the supplied attribute but solely depends on the template
parameter T.