Checks whether T is structurally an integer, i.e. whether it supports
all of the operations an integer type should support. Does not check the
nominal type of T. In particular, for a mutable type T the
following must compile:
Tn;
n = 2;
n <<= 1;
n >>= 1;
n += n;
n += 2;
n *= n;
n *= 2;
n /= n;
n /= 2;
n -= n;
n -= 2;
n %= 2;
n %= n;
boolfoo = n < 2;
boolbar = n == 2;
boolgoo = n < n + 1;
booltar = n == n;
while for a non-mutable type, the above must compile for its unqualified,
mutable variant.
All built-in D integers and character types and std.bigint.BigInt are
integer-like by this definition.
Checks whether T is structurally an integer, i.e. whether it supports all of the operations an integer type should support. Does not check the nominal type of T. In particular, for a mutable type T the following must compile:
while for a non-mutable type, the above must compile for its unqualified, mutable variant.
All built-in D integers and character types and std.bigint.BigInt are integer-like by this definition.