1 static assert( 2 isFloatingPoint!float && 3 isFloatingPoint!double && 4 isFloatingPoint!real && 5 isFloatingPoint!(const(real)) && 6 isFloatingPoint!(immutable(real)) 7 ); 8 9 static assert(!isFloatingPoint!int); 10 11 // complex and imaginary numbers do not pass 12 static assert( 13 !isFloatingPoint!cfloat && 14 !isFloatingPoint!ifloat 15 ); 16 17 // types which act as floating point values do not pass 18 struct S 19 { 20 float val; 21 alias val this; 22 } 23 24 static assert(!isFloatingPoint!S);
Detect whether T is a built-in floating point type.