Operator overloading -- lets collect some use cases

Don nospam at nospam.com
Tue Dec 30 07:58:18 PST 2008


Frits van Bommel wrote:
> Don wrote:
>> A straightforward first step would be to state in the spec that "the 
>> compiler is entitled to assume that X+=Y yields the same result as X=X+Y"
> 
> That doesn't hold for reference types, does it?

I thought it does? Got any counter examples?

  So perhaps this should
> only be the case for structs? (Shouldn't make much difference, I think 
> all of the examples I've seen would normally be implemented as structs 
> rather than objects)



More information about the Digitalmars-d mailing list