On Tuesday, 23 April 2013 at 04:27:45 UTC, Mehrdad wrote:
?!??!

I'm confused by why you might be confused by this. opEquals by default is simply a bit-level value check.

"x" and "x".idup are two different things.

"x" might be:
  ptr = 0xDEADBEEF
  length = 1

and "x".idup might be:
  ptr = 0xDEADBEEE
  length = 1

Clearly they are not equal. If you have a particular definition that isn't the same as the the bit-level basic equality, you have a method of defining it.

For why the compiler treats them the same... well, it simply doesn't create a new place for "x".idup. Simple optimization that doesn't matter unless you're comparing their identity.

Reply via email to