isIntegerLike

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:

T n;
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;
bool foo = n < 2;
bool bar = n == 2;
bool goo = n < n + 1;
bool tar = 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.

Members

Aliases

isIntegerLike
alias isIntegerLike = isIntegerLike!(Unqual!T)
Undocumented in source.

Manifest constants

isIntegerLike
enum isIntegerLike;
Undocumented in source.
isIntegerLike
enum isIntegerLike;
Undocumented in source.
isIntegerLike
enum isIntegerLike;
Undocumented in source.

Meta