Basically to allow template constraints like below, which currently causes an error, saying a semicolon is expected not if statement.
struct Templ(T)
{
void func() if(is(T == float)) // behavior now: Error: semicolon expected...
{
}
}
It's a bit cleaner than having a "static if" wrap the entire function.
Comment #1 by uplink.coder — 2016-10-06T14:02:56Z
do a DIP please.
Comment #2 by razvan.nitu1305 — 2022-11-10T14:45:13Z
The error is now:
test.d(3): Error: cannot use function constraints for non-template functions. Use `static if` instead
Comment #3 by robert.schadek — 2024-12-13T18:50:26Z