The following code fails to compile:
struct Foo
{
void opDispatch (string name, T) () { }
}
void main ()
{
Foo foo;
foo.bar!(int);
}
The error message is:
Error: no property 'bar' for type 'Foo'
Comment #1 by yuriy.glukhov — 2014-04-16T15:30:48Z
Seems like it should be done in the following way (though still does not work with the same error):
struct Foo
{
template opDispatch(string name)
{
void opDispatch (T) () { }
}
}
Comment #2 by robert.schadek — 2024-12-13T18:15:31Z