opIndexAddAssign? ...

Manfred Nowak svv1999 at hotmail.com
Fri Feb 9 16:02:26 PST 2007


Jarrett Billingsley wrote

> I'll have to create a proxy class to hold
> the data which modulos its value by 10 whenever opAssign is used,
> and make an array of that, and create all those class instances. 
This or the other: repeating the same operation for every other  
opIndex<op>Assign, which D currently not has.

> I'm talking about adding
> or setting an index of a container type, not getting one.
Correct. But storing data without any accesses is quite useless. As 
Andrei already pointed out
| Probably the principled thing to do is to allow two functions, one
| that returns lvalue and one that returns an rvalue, and have the
| compiler pick the appropriate one. 
there might be a difference between the representations of data inside 
and outside of classes.

-manfred



More information about the Digitalmars-d mailing list