The type of the integral literal is defined less by whether it is a hexadecimal literal, a decimal literal, or an octal literal and more by the value of the literal.
Table 6 — Types of integer constants, in Section 2.14.2 of the C++11 Standard lists the order of types that will be used to capture an integral literal.
The main difference between decimal literals and hexadecimal and octal literals is that the order of types of decimal literals is int
, long
, long long
while the order of types of hexadecimal and octal literals is int
, unsigned int
, long
, unsigned long
, long long
, and unsigned long long
.