Short list with things to finish for D2

Pelle Månsson pelle.mansson at gmail.com
Fri Nov 20 02:18:03 PST 2009


Andrei Alexandrescu wrote:
> Bill Baxter wrote:
>> On Thu, Nov 19, 2009 at 8:46 AM, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>> grauzone wrote:
>>>> What's with opSomethingAssign (or "expr1[expr2] @= expr3" in general)?
>>>> opBinary doesn't seem to solve any of those.
>>> opBinary does solve opIndex* morass because it only adds one function 
>>> per
>>> category, not one function per operator. For example:
>>>
>>> struct T {
>>>    // op can be "=", "+=", "-=" etc.
>>>    E opAssign(string op)(E rhs) { ... }
>>>    // op can be "=", "+=", "-=" etc.
>>>    E opIndexAssign(string op)(size_t i, E rhs) { ... }
>>> }
>>
>> Rewrite
>> a.prop = x;   =>    a.opPropertyAssign!("prop", "=")(x);
>>
>> to that and we're really getting somewhere!
>>
>> --bb
> 
> I swear I was thinking of that.
> 
> Andrei
Is this doable without a performance drop?



More information about the Digitalmars-d mailing list