Re: Taking the address of an eponymous template

2017-07-31 Thread ag0aep6g via Digitalmars-d-learn
On 07/31/2017 01:59 PM, Arafel wrote: On 07/31/2017 12:14 PM, ag0aep6g wrote: [...] > You'd have to instantiate the inner template, too. Something like > `&c.baz!"a".baz!()`, but that doesn't work. I don't know how you could > make it work. > I tried this as well, and couldn't make it work

Re: Taking the address of an eponymous template

2017-07-31 Thread Arafel via Digitalmars-d-learn
On 07/31/2017 12:14 PM, ag0aep6g wrote: > > You'd have to instantiate the inner template, too. Something like > `&c.baz!"a".baz!()`, but that doesn't work. I don't know how you could > make it work. > I tried this as well, and couldn't make it work either. Do you know if it's supposed to work? I

Re: Taking the address of an eponymous template

2017-07-31 Thread ag0aep6g via Digitalmars-d-learn
On 07/31/2017 11:44 AM, Arafel wrote: ``` class C { [...] template baz(string S) { void baz()() { } } } void main() { [...] void delegate() aBaz = &c.baz!"a"; // This doesn't compile. } ``` If I try &c.baz!"a".baz it doesn't work either (I get a different er

Taking the address of an eponymous template

2017-07-31 Thread Arafel via Digitalmars-d-learn
Hi! I want to create a delegate out of a method that happens to be an eponymous (nested) template, like this: ``` class C { void foo() {} void bar(string S)() { } template baz(string S) { void baz()() { } } } void main() {