octal facility provides a means to declare a number in base 8.
octal!"177" for 127 represented in octal
(same as 0177 in C).
enum octal(string num) = octal!int(num);enum octal(alias decimalInteger) = octal!(typeof(decimalInteger))(to!string(decimalInteger));
The rules for strings are the usual for literals: If it can fit in an
int, it is an
int. Otherwise, it is a
long. But, if the
user specifically asks for a
long with the
L suffix, always
long. Give an unsigned iff it is asked for with the
u suffix. Octals created from integers preserve the type
of the passed-in integral.
parse for parsing octal strings at runtime.
// same as 0177 auto x = octal!177; // octal is a compile-time device enum y = octal!160; // Create an unsigned octal auto z = octal!"1_000_000u";