How would you solve this problem: do an optional function call depending on some version(X). If version(X) is not defined, there should be no call and no extra code at -O0.

```
{
...
   foo();  // either compiles to a function call, or to _nothing_.
...
}
```

In C, you could do something like:
```
#if X
  void foo() {......}
#else
  #define foo()
#endif
```

How would you do this in D?

I can think of `mixin(foo())` but there is probably a nicer way that preserves normal function calling syntax.

Cheers,
  Johan

Reply via email to