template - aliasing a member function

2012-08-08 Thread Ellery Newcomer
say I have template T(alias fn) { } class Foo { int i(); void i(int); } alias T!(Foo.i) Biz; Is there a way to get a handle to both of the overloads of Foo.i inside T? Actually, all I really need for that is to get 'Foo.i' out of fn. mangleof looks promising..

Re: template - aliasing a member function

2012-08-08 Thread Kenji Hara
On Wednesday, 8 August 2012 at 23:21:32 UTC, Ellery Newcomer wrote: say I have template T(alias fn) { } class Foo { int i(); void i(int); } alias T!(Foo.i) Biz; Is there a way to get a handle to both of the overloads of Foo.i inside T? Actually, all I really need for that is to get

Re: template - aliasing a member function

2012-08-08 Thread Ellery Newcomer
On 08/08/2012 04:21 PM, Ellery Newcomer wrote: mangleof looks promising.. .. or maybe not. wtf? template Z(string s) { pragma(msg, fn.mangleof 2: ~ s); } struct S(alias fn, string prop) { pragma(msg, fn.mangleof 1: ~ fn.mangleof); alias Z!(fn.mangleof) F; } class Foo{

Re: template - aliasing a member function

2012-08-08 Thread Philippe Sigaud
On Thu, Aug 9, 2012 at 2:00 AM, Ellery Newcomer ellery-newco...@utulsa.edu wrote: Awesome, thanks. And to make this work with property functions (which is my real target case): pragma(msg, FunctionTypeOf!(Overloads[0])); // prints @property int() pragma(msg,