Confused about class equality
strtr
strtr at spam.com
Sun Apr 4 10:14:29 PDT 2010
Ali Ãehreli Wrote:
>
> The code works as expected with 2.042
>
> I had to modify the toString() functions to return string, and say
> "override" in C's toString definition; and had to modify the writefln()
> calls:
>
> writefln("%s : %s %s", i2.toString(), i2.__vptr, i2.__monitor);
>
> The output:
>
> Same Value.
> Same Object.
> 3 : 806D3F4 0
> 3 : 806D3F4 0
> 5 : 806D3F4 0
> 5 : 806D3F4 0
>
> Ali
I probably wasn't clear about what exactly my problem is :
Somehow in my (D1) program two object references have different vpointers/monitors and thus fail in "is" equality but I can change both objects with one call.
More information about the Digitalmars-d-learn
mailing list