On Mon, 09 Jul 2012 07:44:24 -0400, Timon Gehr <timon.g...@gmx.ch> wrote:
On 07/09/2012 08:37 AM, Adam Wilson wrote:
Object is now const-correct throughout D. This has been a dream for many
of you. Today it is a reality.
PITA. Forced const can severely harm a code base that wants to be
flexible -- it leaks implementation details and is infectuous.
Any options planned to allow not inheriting all the cruft from Object if
it is of no use?
Eg:
// object.di
class RawObject { }
class Object : RawObject { ... }
// user.d
class C { } // inherits from Object
class D : RawObject { } // this does not
Two solutions:
1. object.opEquals(T : Object, U : Object) (T t, U u) which can use
mutable opEquals for derived types
2. define a non-operator equality function, i.e. mutableEquals(). Can be
attached to actual opEquals with struct wrapper.
These are not insolvable problems.
-Steve