allSameType

template allSameType (
T...
) {
enum bool allSameType;
enum bool allSameType;
}

Return Value

true iff all types T are the same.

Examples

static assert(allSameType!(int, int));
static assert(allSameType!(int, int, int));
static assert(allSameType!(float, float, float));
static assert(!allSameType!(int, double));
static assert(!allSameType!(int, float, double));
static assert(!allSameType!(int, float, double, real));
static assert(!allSameType!(short, int, float, double, real));

Meta

Suggestion Box / Bug Report