Pointers, casting, SetGetWindowLong problem...

Jarrett Billingsley kb3ctd2 at yahoo.com
Fri Mar 9 19:40:26 PST 2007

"Chris Warwick" <sp at m.me.not> wrote in message 
news:est492$1igu$1 at digitalmars.com...
> Seems odd that it's even implemented at all, = is not overloadable if i 
> understood the docs right,

Nope, it's assignable with opAssign.  There are restrictions, but it can be 

> and I cant see add or sub being overloaded in Object.. So why implement 
> opEquals? Especialy when it's basicly worse than (obj1 is obj2).

It's implemented for associative arrays to work properly.

> Unless it's a cunning ploy, using AV faults to cattle prod people into 
> using 'is'.

Well == and 'is' have two entirely different purposes.  == is only for 
seeing if two things have the same _value_, while 'is' is used to see if 
_two references point to the same instance_.  == is perfectly fine to use on 
class instances -- as long as they're not null!  It's just like any other 

More information about the Digitalmars-d-learn mailing list