On Saturday, 7 July 2018 at 11:56:40 UTC, rikki cattermole wrote:
   void bar (T ...) (T args) if (T.length == 0)
   {
      return;

[...]
   }

   void bar (T ...) (T args) if (T.length > 0)
   {
      writeln (args [0]);
      return bar (args [1 .. $]);
   }

This is a version without a second condition:

   import std.stdio;

   void foo ()
   {
      writeln;
   }

   void foo (T ...) (T args) if (T.length > 0)
   {
      writeln ("arg = ", args [0]);
      foo (args[1 .. $]);
   }

   void main ()
   {
      foo ();
      foo (1);
      foo (1, "2");
      foo (1, 2, 3.);
   }

Reply via email to