Generally there is a strong correlation between default initialization and boolean evaluation to false
. Excepted for floating point and characters types :
void main(string[] args)
{
void* v;
assert(!v);
int s32;
assert(!s32);
long s64;
assert(!s64);
class C {}
C c;
assert(!c);
struct S { bool opCast(T)(){return true;} }
S s;
assert(s);
// etc ...
float f64;
assert(!f64);
}
instead of an assertion failure what we should get is rather a message such as
error, cannot evaluate f64
to a bool