Forbid dynamic arrays in boolean evaluation contexts

Steven Schveighoffer schveiguy at yahoo.com
Mon Mar 25 12:20:17 PDT 2013


On Mon, 25 Mar 2013 11:44:22 -0400, Jacob Carlborg <doob at me.com> wrote:

> I just started to use this in one place :(
>
> if (auto a = getArray()) { }
>
> getArray returns null if now array exists.

That one is not as easy.  It will have to be split into two lines, the  
declaration and the test.

-Steve


More information about the Digitalmars-d mailing list