<p><br>
> You can check if arbitrary code compiles with the "if-typeof-delegate-trick":<br>
> --<br>
> static if(is(typeof({ <code>}))))<br>
> {<br>
> // code compiles<br>
> }<br>
> --</p>
<p>Or with __traits(compiles, <code>), which better documents the intent.<br>
</p>