Re: call member function alias

2012-08-24 Thread Ellery Newcomer
On 08/23/2012 11:47 PM, Jacob Carlborg wrote: How about this: import std.stdio; class Foo { auto forward (alias fn, Args...) (Args args) { return fn(args); } void bar (int a = 3) { writeln("bar ", a); } } auto call (alias fn, T, Args...) (T t,

Re: call member function alias

2012-08-23 Thread Jacob Carlborg
On 2012-08-23 21:51, Ellery Newcomer wrote: if I have a member function alias and corresponding object and arguments, is there any way to turn them into a member function call? e.g. class X{ void a(); } auto profit(alias fn, T, Args...)(T t, Args args) { ??? } profit!(X.fn, X)(x); Const

call member function alias

2012-08-23 Thread Ellery Newcomer
if I have a member function alias and corresponding object and arguments, is there any way to turn them into a member function call? e.g. class X{ void a(); } auto profit(alias fn, T, Args...)(T t, Args args) { ??? } profit!(X.fn, X)(x); Constraints are: 1) must conserve ability to omit