maxSize

Gives the sizeof the largest type given.

template maxSize (
T...
) {
enum size_t maxSize;
enum size_t maxSize;
}

Examples

static assert(maxSize!(int, long) == 8);
static assert(maxSize!(bool, byte) == 1);

struct Cat { int a, b, c; }
static assert(maxSize!(bool, Cat) == 12);

Meta

Suggestion Box / Bug Report