Forbid dynamic arrays in boolean evaluation contexts

bearophile bearophileHUGS at lycos.com
Mon Mar 25 08:04:58 PDT 2013


Steven Schveighoffer:

> I would favor just changing the behavior.

If you just change the behavior, then I suggest to take in 
account associative arrays too:


void main() {
     bool[int] aa;
     assert(!aa);
     aa = [1: true];
     assert(aa);
     aa.remove(1);
     assert(aa);
     assert(!aa.length);
}


Bye,
bearophile


More information about the Digitalmars-d mailing list