Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-12-12 13:08:47

From: "Iain K.Hanson" <iain.hanson_at_[hidden]>
> Given the above, I can't see the utility of defining rel-ops with
> semantics.

I did not say that there is utility in the "equivalence" semantics (although
they do make specifying and testing postconditions easier.) I am saying that
these are the only semantics that make sense, if comparisons are supported
at all.

> Particularly as if opt1 == opt2 returns false you have no idea
> if it is because there is a value mis-match or a state mis-match.

This is how equivalence works. It doesn't tell you anything about opt1 or
opt2, it only tells you whether the two are equivalent, i.e. whether opt2
can be substituted for opt1 in an expression with the end result being the
same. (For any type.)

> I can see the logic in your argument, but given that optional is neither
> "fish nor fowl" ( its not a smart pointer, its not a container, and its
> just a value ), I would rather go for the semantics that offer most

That's fine. State comparisons offer no utility. ;-)

Boost list run by bdawes at, gregod at, cpdaniel at, john at