On Saturday, 2 December 2023 at 15:03:25 UTC, ryuukk_ wrote:
I wish we could use ``version`` as expression, to void the repetition:

```D
import std.stdio;

enum HasTest = version (Test) ? true : false;

Tomek SowiƄski wrote this template:
```d
enum bool isVersion(string ver) = !is(typeof({
          mixin("version(" ~ ver ~ ") static assert(0);");
    }));

static assert(isVersion!"assert");
static assert(!isVersion!"Broken");
```

Reply via email to