Difference between is and ==

Martijn Pot martijnpot52 at gmail.com
Tue Feb 4 00:18:36 PST 2014


On Tuesday, 4 February 2014 at 08:08:30 UTC, Suliman wrote:
> What difference between
> if ((x = stdin.readln().chomp) is "q")
> and
> if ((x = stdin.readln().chomp) == "q")
>
> ?

My interpretation of tdpl p57:

'is' compares for alias equality for arrays and classes.
Otherwise they are the same.


More information about the Digitalmars-d-learn mailing list