On Wed, Oct 22, 2008 at 7:01 AM, Jason House <[EMAIL PROTECTED]> 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
