What is the state of opAssign?
BCS
ao at pathlink.com
Sun Oct 21 12:50:40 PDT 2007
Reply to Nathan,
> Frankly, I think this is a very bad idea. With the usual semantics of
> assignment are it *doesn't* depend on the current value of the lhs.
> Overloading an operator such that its semantics violates the
> assumptions programmers normally make about it is never good imho.
> This is why D doesn't allow commutative operators to be overloaded as
> non-commutative, etc...
>
> Thanks,
> Nathan Reed
Point taken. However In the case I'm using, the semantics would be as expected
because I'd be modeling a different semantic system. OTOH, I think I might
be able to avoid that issue by defining the assignment from the left side
(I might be forced to anyway by other constrains).
More information about the Digitalmars-d-learn
mailing list