opOpAssign of AA: defined behavior?

Eduard Staniloiu edi33416 at gmail.com
Tue Jun 23 11:19:10 UTC 2020


On Tuesday, 23 June 2020 at 09:15:57 UTC, WebFreak001 wrote:
> [...]
>
> it will give me a range violation at runtime and not init it 
> for me at all.
>
> There is `aa.require("a", Foo.init) += 4;` now which solves 
> this, but I would prefer having the small simple syntax well 
> defined for all types instead of only primitives. Also I don't 
> see anywhere in the specification that `require` must actually 
> return a ref value, so I can't trust this either.

You make a very good case.

I think this would make a great bootcamp issue 
(https://issues.dlang.org/)

Cheers,
Edi



More information about the Digitalmars-d-learn mailing list