The definition of templates in D

Derek ddparnell at bigpond.com
Sun Mar 18 00:06:49 PDT 2012


On Sun, 18 Mar 2012 17:01:00 +1100, FeepingCreature  
<default_357-line at yahoo.de> wrote:

> There's a shortcut for this, called IFTI, "implicit function template  
> instantiation" ...
>

What would be useful is ...


  template bar(T...){ void bar(T t) { writefln(t); } }

  int a,b,c;
  bar!(a, b, c); // is equivalent to
  bar!(int, int, int).bar(a, b, c);

-- 
Derek Parnell
Melbourne, Australia


More information about the Digitalmars-d mailing list