member function as template parameter workaround needed

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Sep 13 16:47:56 PDT 2012


On 9/14/12, timotheecour <thelastmammoth at gmail.com> wrote:
> Also I can't pass &a.fun2 as fun2 is not static.

Why not pass it as a runtime argument?

void run(Fun, T...)(Fun fun, T args)
{
    writeln(typeid(ParameterTypeTuple!(fun)));
    fun(args);
}

void test()
{
    auto a = new A;
    run(&a.fun, 10);
}


More information about the Digitalmars-d-learn mailing list