www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Template alias parameter does not accept primitives?

     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?

  1. http://codepad.org/GQFBdC0T
  2. http://ideone.com/yke0h
Mar 05 2011