template Test(T) { alias int V; void test(T t) {} }
Test!(int).test(0); //OK
template test(T) { alias int V; void test(T t) {} }
test!(int)(0); //Error
test(0) //Error
template test(T) { void test(T t) {} }
test!(int)(0); //OK
test(0); //OK
Comment #1 by 2korden — 2008-08-12T09:41:29Z
This is not a bug, it is by desing.
If you create exactly one symbol (an alias, variable or a function) and it matches the template name, you can access it without fully qualified name, like this:
template foo()
{
const int foo = 42;
}
const int f = foo();
but if you introduce a second symbol then you should fully specify it:
template foo()
{
void foo() {}
int bar(int i) { return i; }
}
foo!().foo();
int bar = foo!().bar(42);
http://www.digitalmars.com/d/1.0/template.html