Forbid dynamic arrays in boolean evaluation contexts

Andrea Fontana nospam at example.com
Mon Mar 25 07:15:38 PDT 2013


On Sunday, 24 March 2013 at 22:10:06 UTC, bearophile wrote:
> import std.array: empty;
> void main() {
>     auto a = [1];
>     if (a.empty) {} // OK
>     if (a is null) {} // OK
> }
>
>
> Bye,
> bearophile

why not a.length == 0 ?


More information about the Digitalmars-d mailing list