Reference counted containers prototype

kenji hara k.hara.pg at gmail.com
Tue Dec 27 08:55:31 PST 2011


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 <SeeWebsiteForEmail at 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
>


More information about the Digitalmars-d mailing list