Template alias parameter does not accept primitives?

KennyTM~ kennytm at gmail.com
Sat Mar 5 01:32:14 PST 2011


     template Foo(alias A) {
         alias A Foo;
     }
     Foo!(int) x;

This piece of code will not compile in both D1 and D2 because 'int' 
cannot be matched with 'alias A'. Is this expected? Why is that?


Refs:
  1. http://codepad.org/GQFBdC0T
  2. http://ideone.com/yke0h


More information about the Digitalmars-d mailing list