Could that bug be catch using D's way?

Basile B. b2.temp at gmx.com
Mon Feb 19 21:57:04 UTC 2018


On Monday, 19 February 2018 at 21:34:04 UTC, Simen Kjærås wrote:
> On Monday, 19 February 2018 at 14:20:16 UTC, Basile B. wrote:
>> I had never used Checked and i discover that strangely there's 
>> no hook for opAssign. onLowerBound and onUpperBound works for 
>> +=, -=, *=, /=, %=, ^^=, &=, |=, ^=, <<=, >>=, and >>>=. But 
>> since init is 0, += works:
>
> Ah, thanks. Filed a bug:
> https://issues.dlang.org/show_bug.cgi?id=18471
>
> --
>   Simen

I think this is a design choice, it's too obvious to be an 
omission (it's even documented that opAssign is like the ctor).

I'm curious to know what's the rationale though.


More information about the Digitalmars-d-learn mailing list