[Issue 1661] Not possible to specialize on template with integer parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 29 05:59:49 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1661





------- Comment #7 from wbaxter at gmail.com  2008-02-29 07:59 -------
Am I right in thinking this is the actual syntax that should work?:

struct test_specialize(T : Number!(N), int N)
{
    void talk() { writefln("Ooh special - NUMBER N\n"); }
}
test_specialize!(Number!(5)) x;


That's a minor variation on an example in the docs:

  template Foo(T: T[U], U)
  {
      ... 
  }
  Foo!(int[long]) // instantiates Foo with T set to int, U set to long


(But the int-arg version still doesn't work, I'm just checking that the above
is what *should* work.)


-- 



More information about the Digitalmars-d-bugs mailing list