www.digitalmars.com         C & C++   DMDScript  

D - alias in templates

has someone already spotted that alias effect templates

template L8Interface( T, I : IID ) {
 class obj {
  T cast_with( IID* riid, Object o ) {
   if ( *riid == I ) {
    return (T)o;
   }
   return null;
  }
 }
}
instance L8Interface( IUnknown, IID_IUnknown ).obj L8_IUnknown;
causes the error
instance L8Interface(IUnknown ,IID_IUnknown) does not match any template
declaration
strangely
instance L8Interface( IUnknown, &IID_IUnknown ).obj L8_IUnknown;
causes the error
instance L8Interface(IUnknown ,#IID_IUnknown) does not match any template
declaration
but template L8Interface( T, I :GUID ) ....
works
Aug 02 2003