On 02/04/16 16:32, Artur Skawina wrote:
> 
>    void print(A...)(A a) {
>       foreach (N, ref e; a)
>          write(e, N==A.length-1?"\n":" ");
>    }

BTW, that was *deliberately* written that way as a compromise
between efficiency and template bloat. It can of course be
done like

   void print(alias SEP=" ", alias EOL="\n", A...)(A a) {
      
mixin(`write(`~iota(A.length).map!(a=>"a["~text(a)~"],")().join("SEP,")~"EOL);");
   }

but that seems too expensive, when the use is just in toy
programs and debugging.


artur

Reply via email to