On Sunday, 2 December 2012 at 15:09:17 UTC, js.mdnq wrote:
Can this be made to work in D?

Error in D, x not found:

if (auto x = "thing" in arr && x == 45)
{

}

You can't have both a declaration and expression in an if-statement.

http://dlang.org/statement.html#IfStatement

IfStatement:
    if ( IfCondition ) ThenStatement
    if ( IfCondition ) ThenStatement else ElseStatement

IfCondition:
    Expression
    auto Identifier = Expression
    BasicType Declarator = Expression

Reply via email to