DMD 1.036 and 2.020 releases
Bill Baxter
wbaxter at gmail.com
Tue Oct 21 16:02:35 PDT 2008
On Wed, Oct 22, 2008 at 7:01 AM, Jason House
<jason.james.house at gmail.com> wrote:
> Bill Baxter Wrote:
>
>> Is there a good reason why it shouldn't be possible to use opAssign as
>> a replacement for opIndexAssign?
>>
>> --bb
>
> opindexAssign will still be needed when opindex has a non-ref return type.
>
Yep, definitely shouldn't get rid of opIndexAssign. It's still a nice
advantage of D over C++ when you want to monitor and control all
modifications to an array-like object.
But if the opIndex does return a ref, and an opIndexAssign has not
been defined then I don't see why that opIndex shouldn't allow users
to say foo[10] = x. Instead of *(&foo[10])=x;
--bb
More information about the Digitalmars-d-announce
mailing list