C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Values of objects
From: Hyman Rosen (hyrosen_at_[hidden])
Date: 2019-08-28 13:09:14


On Wed, Aug 28, 2019 at 1:14 PM language.lawyer--- via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> The same sequence of bits in value representation can mean different
> values.
>

What do you mean by different? The same sequence of bits in value
representation (should) mean that the two objects have the "same" value,
by definition. The values returned by operator== and related functions
can be whatever those functions find useful, and we should refer to such
values as "equal" and "not equal."

Floating-point gives us such behavior - two values having the same value
representation of a NaN cause operator== to report false. Two different
value representations, +0 and -0, cause operator== to report true.



STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups