ProxyOf rewrites the expression > obj.foo!(bar, baz)(a, b); to
obj.opDispatch!("foo").opDispatch!(bar, baz)(a, b) // opDispatch!("foo").opDispatch generates a temporary member template for forwarding. // And it is actually processed as 'eponymous template'. Thanks. Kenji Hara 2011/12/28 Andrei Alexandrescu <seewebsiteforem...@erdani.org>: > On 12/27/11 5:27 AM, kenji hara wrote: >> >> I've already posted a dmd patch to fix all of opDispatch problems: >> >> https://github.com/D-Programming-Language/dmd/pull/280 > > > As far a I understand you pass the whole template as a string inside > opDispatch? For example, say obj defines opDispatch: > > obj.foo!(bar, baz)(a, b); > > Would that be rewritten as > > obj.opDispatch!("foo!(bar, baz)")(a, b); > > ? > > That would be great. > > >> With it, I've posted a useful library utility to implement >> 'super-type' like D1 typedef: >> >> https://github.com/D-Programming-Language/phobos/pull/300 >> >> I'm naming it 'ProxyOf', and it supports various of forwardings, >> function call, property access, and specialized template member >> function. >> >> Kenji Hara > > > Thanks! Sorry I didn't look over ProxyOf first, it might have saved me some > work. I'll do so soon. > > Andrei >