Pointers, casting, SetGetWindowLong problem...

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Mar 10 09:41:30 PST 2007


"Chris Warwick" <sp at m.me.not> wrote in message 
news:esu8ah$4uj$1 at digitalmars.com...
>
> Just feels kinda wrong to me. Objects are referance types, passed by, and 
> managed by referance, so imo == and = should test and assign referance not 
> value.

= does assign reference, except if opAssign is overloaded (I don't like 
opAssign with classes for that reason; for structs it makes more sense). 
The nice thing about having '==' vs. 'is' for reference types is that you 
don't have to write

if(obj1.equals(obj2))
    // ...

like in certain other languages.

On a side note, I just like the way 'is' reads more than '=='.  And you can 
even use it with non-reference types, where it acts just like '==', so you 
can write things like

if(x is 5)

Which just looks great IMO :) 




More information about the Digitalmars-d-learn mailing list