Why this eponymous template does not compile?

Victor Porton porton at narod.ru
Mon Mar 25 09:27:03 UTC 2019


///
template sychronizedMemoize(alias fun) {
     void sychronizedMemoize() { }
}

void f() { }

void main()
{
     synchronizedMemoize!f();
}
///

/tmp/temp_7F3C101460D0.d(9,5): Error: template instance 
`synchronizedMemoize!f` template `synchronizedMemoize` is not 
defined, did you mean sychronizedMemoize(alias fun)()?

Why the error? Is it compiler bug? DMD v2.084.1


More information about the Digitalmars-d-learn mailing list