Please tell me this is a bug?

Peter Alexander via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 21 18:52:45 PST 2015


On Sunday, 22 February 2015 at 02:35:02 UTC, Adam D. Ruppe wrote:
> On Sunday, 22 February 2015 at 02:27:30 UTC, Peter Alexander 
> wrote:
>> Seems questionable to me. Anyone know the rationale?
>
> I actually agree it is a bit questionable, but I think the 
> difference is += is, conceptually at least, atomic - it is a 
> single function, append() instead of two calls, 
> set(calculate()).

I can see where you are coming from, but the fact of the matter 
is that it is evaluated no differently than a = a + b. Why, in 
the a += b case, does it somehow become acceptable for the 
compiler to irresponsibly insert in an implicit narrowing 
conversion?



More information about the Digitalmars-d mailing list