Re: Template delegate/function ptr struct member

2014-05-13 Thread uri via Digitalmars-d-learn
On Tuesday, 13 May 2014 at 07:50:09 UTC, Rikki Cattermole wrote: On 13/05/2014 7:28 p.m., ed wrote: I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to accep

Re: Template delegate/function ptr struct member

2014-05-13 Thread Rikki Cattermole via Digitalmars-d-learn
On 13/05/2014 7:28 p.m., ed wrote: I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to accept delegates for future use without breakage to existing code... I

Template delegate/function ptr struct member

2014-05-13 Thread ed via Digitalmars-d-learn
I'm porting some C++ code to D and a struct has the following member: struct S { // ... //void* (*createMethod)(); void* function() createMethod; } I'd like to extend this as little to accept delegates for future use without breakage to existing code... Is it possible to template this so