On 7/7/18 7:28 AM, kdevel wrote:
It appears not to be possible to use static if in "guard clause style" as invoid bar (T ...) (T args) { static if (args.length == 0) return; writeln (args [0]); return bar (args [1 .. $]); } Is this intended?
Yes.Try just a normal if -- it will have the same effect (the optimizer will eliminate the dead code), but will compile.
Of course, you have to fix your second part to only return bar if args.length > 0!
-Steve