[your code here]

Stefan Koch uplink.coder at googlemail.com
Wed Jan 30 00:54:14 UTC 2019


On Wednesday, 30 January 2019 at 00:48:37 UTC, Jonathan M Davis 
wrote:
> On Tuesday, January 29, 2019 4:45:58 PM MST Stefan Koch via 
> Digitalmars-d wrote:
>> [...]
>
> That's not quite true. To be precise, is does a bitwise 
> comparison. In the case of integers, that's the same as ==, but 
> for floating point values, it's not the same (most notably with 
> NaN). Also, it's definitely different for structs. So, it's not 
> just arrays and classes that differ for == and is.
>
> For this code, both is or == would work, but it's certainly 
> more idiomatic to use == - to the point that if I saw someone 
> using the is operator with integers, I would be wondering if 
> they understood what they were doing or were trying to do 
> something other than what they were actually doing.
>
> - Jonathan M Davis

Oh really, darn looks like I need to fix newCTFE then.


More information about the Digitalmars-d mailing list