On Sunday, 24 March 2019 at 16:18:49 UTC, sighoya wrote:
Whyauto GenIf()() {return mixin("if(true) { return true;} else {return false;}");} public bool testFunction2() { GenIf!(); } gives me: onlineapp.d-mixin-3(3): Error: expression expected, not ifonlineapp.d(8): Error: template instance `onlineapp.GenIf!()` error instantiating
Because D uses if statements, no if expressions. The equivalent of an if expression is the ternary operator: bool-condition ? if-true : if-false;