guard clause style static if

rikki cattermole rikki at cattermole.co.nz
Sat Jul 7 11:29:35 UTC 2018


On 07/07/2018 11:28 PM, kdevel wrote:
> It appears not to be possible to use static if in "guard clause style" 
> as in
> 
>     void bar (T ...) (T args)
>     {
>        static if (args.length == 0)
>           return;

else {

> 
>        writeln (args [0]);
>        return bar (args [1 .. $]);

}

>     }


More information about the Digitalmars-d-learn mailing list