Template declaration/instantiation

Carlos Santander csantander619 at gmail.com
Sat Mar 4 08:06:20 PST 2006


Tom escribió:
> Just for curiosity: why template declaration doesn't use '!()' instead of '()'.
> Wouldn't using the same symbols in both (the declaration and the instantiation)
> be a little more "consistent" to the sight?
> 
> Regards,
> 
> Tom;

The ! syntax was added after the () syntax. Formerly, it was:

template Foo(T)
{
}

class A
{
}

instance Foo(int) Foo_int;
instance Foo(A) Foo_A;

Later on, instance was deprecated and ! came to life. I believe the instance 
syntax is not valid now.

-- 
Carlos Santander Bernal



More information about the Digitalmars-d mailing list