function-local template specialization error
canalpay
canalpayciftci at gmail.com
Wed Jul 14 01:49:21 PDT 2010
void main()
{
T input(T)()
{}
T input(T : string)()
{}
}
Error message :
isimsiz.d(6): found 'input' when expecting ';' following statement
isimsiz.d(6): found ':' when expecting ')'
isimsiz.d(6): found 'string' when expecting ';' following statement
isimsiz.d(6): found ')' instead of statement
isimsiz.d(8): unrecognized declaration
Shouldn't that work?
And
void main()
{
void input(T)()
{}
void input(T : string)()
{}
}
Again, Shouldn't that work?
Error message:
isimsiz.d(6): Error: declaration input(T : string) is already defined
there is no problem when the templates are in the global namespace.
More information about the Digitalmars-d-learn
mailing list