On Sunday, 25 February 2018 at 00:42:20 UTC, Seb wrote:
On Sunday, 25 February 2018 at 00:36:16 UTC, kdevel wrote:
   [...]

Are you looking for something like this?

---
static if (__traits(compiles, () { static foreach (i; [0]){} }))
    version = supportsStaticForeach;

void main()
{
    version(supportsStaticForeach) {
       pragma(msg, "Yay, your compiler is new enough.");
    }
}
---


https://run.dlang.io/is/PZN5Nv

[...]

Don't support GDC (or only GDC-master)?

Ah sorry I replied too fast. Yeah `mixin` is the only way to workaround this if you really, really have to support GDC.

Reply via email to