Re: Using delegates in callbacks for extern(C) functions

2012-02-27 Thread Ali Çehreli
On 02/25/2012 08:12 AM, Timon Gehr wrote: On 02/24/2012 07:22 PM, simendsjo wrote: I have a C function taking a callback function as a parameter. My thought was to wrap this up using a template, but I cannot get it to work: extern(C) alias void function() Callback; template Wrap(alias dg)

Re: Using delegates in callbacks for extern(C) functions

2012-02-27 Thread Jonathan M Davis
On Monday, February 27, 2012 16:42:06 Ali Çehreli wrote: On 02/25/2012 08:12 AM, Timon Gehr wrote: On 02/24/2012 07:22 PM, simendsjo wrote: I have a C function taking a callback function as a parameter. My thought was to wrap this up using a template, but I cannot get it to work:

Re: Using delegates in callbacks for extern(C) functions

2012-02-25 Thread simendsjo
On Sat, 25 Feb 2012 17:12:50 +0100, Timon Gehr timon.g...@gmx.ch wrote: On 02/24/2012 07:22 PM, simendsjo wrote: I have a C function taking a callback function as a parameter. My thought was to wrap this up using a template, but I cannot get it to work: extern(C) alias void function()

Using delegates in callbacks for extern(C) functions

2012-02-24 Thread simendsjo
I have a C function taking a callback function as a parameter. My thought was to wrap this up using a template, but I cannot get it to work: extern(C) alias void function() Callback; template Wrap(alias dg) { extern(C) void Wrap() { dg(); } } void main() { Callback cb