Why are opEquals/opCmp arguments not in or const for Objects?

Jonathan M Davis jmdavisProg at gmx.com
Sun Mar 17 18:06:46 PDT 2013


On Monday, March 18, 2013 02:00:37 Peter Williams wrote:
> Can't those (rare) implementations just do a non constant cast
> when they cast Object to their desired class?

No. In D, casting away const on an object and mutating it is undefined 
behavior.

- Jonathan M Davis


More information about the Digitalmars-d mailing list