1 static assert( 2 isNumeric!byte && 3 isNumeric!short && 4 isNumeric!int && 5 isNumeric!long && 6 isNumeric!float && 7 isNumeric!double && 8 isNumeric!real && 9 isNumeric!(const(real)) && 10 isNumeric!(immutable(real)) 11 ); 12 13 static assert( 14 !isNumeric!void && 15 !isNumeric!bool && 16 !isNumeric!char && 17 !isNumeric!wchar && 18 !isNumeric!dchar 19 ); 20 21 // types which act as numeric values do not pass 22 struct S 23 { 24 int val; 25 alias val this; 26 } 27 28 static assert(!isIntegral!S);
Detect whether T is a built-in numeric type (integral or floating point).