> You can check if arbitrary code compiles with the "if-typeof-delegate-trick":
> --
> static if(is(typeof({ <code>}))))
> {
> // code compiles
> }
> --

Or with __traits(compiles, <code>), which better documents the intent.