Re: Alias to template instance wokrs, but non-template does not?

2019-05-15 Thread Dukc via Digitalmars-d-learn
On Tuesday, 14 May 2019 at 14:36:21 UTC, Q. Schroll wrote: [snip] I've filed a bug report [1] some time ago. I'm posting here, because I want to understand what's going on here. I read through this post and while I don't know precisely what the compiler is thinking, it seems for me that your

Alias to template instance wokrs, but non-template does not?

2019-05-14 Thread Q. Schroll via Digitalmars-d-learn
I have the rather strange question: Why does this work? struct S { int value0; alias opApply = opApplyImpl!(int delegate(ref int)); //1 int opApplyImpl(DG : int delegate(ref int))(scope DG callback) //2 { if (auto result = callback(value0))