delegate, template and alias

2011-12-18 Thread Heromyth
I have a delegate as a parameter in a function which is a template function. And I want to use alias for the delegate parameter. Is there a better way for this? My demo code: template AsynchronousAction(T) { alias void delegate(T argument) FuncType; } public class TestC { int b =

Re: delegate, template and alias

2011-12-18 Thread Philippe Sigaud
On Sun, Dec 18, 2011 at 14:13, Heromyth wrote: > I have a delegate as a parameter in a function which is a template function. > And I want to use alias for the delegate parameter. > Is there a better way for this? I suppose you do *not*want the commented line? You can extract a template paramete

Re: delegate, template and alias

2011-12-19 Thread Heromyth
== Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article > On Sun, Dec 18, 2011 at 14:13, Heromyth wrote: > > I have a delegate as a parameter in a function which is a template function. > > And I want to use alias for the delegate parameter. > > Is there a better way for this? > I supp

Re: delegate, template and alias

2011-12-19 Thread Heromyth
== Quote from Heromyth (bitwo...@qq.com)'s article > == Quote from Philippe Sigaud (philippe.sig...@gmail.com)'s article > > I suppose you do *not*want the commented line? > I want to convert a delegate type define in C# to D's, as such: > public delegate void AsynchronousAction(T argument, Asy

Re: delegate, template and alias

2011-12-19 Thread Philippe Sigaud
On Mon, Dec 19, 2011 at 15:35, Heromyth wrote: > Woo, I got it. What's the difference with your first post?

Re: delegate, template and alias

2011-12-19 Thread Timon Gehr
On 12/19/2011 06:46 PM, Philippe Sigaud wrote: On Mon, Dec 19, 2011 at 15:35, Heromyth wrote: Woo, I got it. What's the difference with your first post? He uses an eponymous template now.

Re: delegate, template and alias

2011-12-19 Thread Philippe Sigaud
On Mon, Dec 19, 2011 at 18:49, Timon Gehr wrote: > On 12/19/2011 06:46 PM, Philippe Sigaud wrote: >> >> On Mon, Dec 19, 2011 at 15:35, Heromyth  wrote: >>> >>> Woo, I got it. >> >> >> What's the difference with your first post? > > > He uses an eponymous template now. Ah yes, thanks. Strange, I'm

Re: delegate, template and alias

2011-12-19 Thread Timon Gehr
On 12/19/2011 09:30 PM, Philippe Sigaud wrote: On Mon, Dec 19, 2011 at 18:49, Timon Gehr wrote: On 12/19/2011 06:46 PM, Philippe Sigaud wrote: On Mon, Dec 19, 2011 at 15:35, Heromythwrote: Woo, I got it. What's the difference with your first post? He uses an eponymous template now

Re: delegate, template and alias

2011-12-19 Thread Philippe Sigaud
On Tue, Dec 20, 2011 at 00:23, Timon Gehr wrote: > Looks very good. > > Knowing it is a work in progress, I will already give some feedback: (snip) Wow, thanks for the thorough reading! I'll correct thos points. I need to write a code extractor to automatically compile the examples, because I'm

Re: delegate, template and alias

2011-12-20 Thread Heromyth
== Quote from Timon Gehr (timon.g...@gmx.ch)'s article > On 12/19/2011 09:30 PM, Philippe Sigaud wrote: > > On Mon, Dec 19, 2011 at 18:49, Timon Gehr wrote: > > > > Anyway, Heromyth, I'm slowly working on a D template tutorial. The > > current pdf is at: > > > > https://github.com/PhilippeSigaud/D