nitpick: You can remove `static if`s, and could rewrite `static assert`s to:

```d
static assert(is_exp == !__traits(compiles, __traits(parent, X)));
static assert(is_exp == !__traits(compiles, __traits(getAttributes, X)));
static assert(is_exp == !__traits(compiles, __traits(getProtection, X)));
```