Boost logo

Boost :

Subject: Re: [boost] [optional] operator<(optional<T>, T) -- is it wrong?
From: Vladimir Batov (Vladimir.Batov_at_[hidden])
Date: 2014-11-27 15:35:35


On 11/28/2014 12:22 AM, Andrzej Krzemienski wrote:
> ... Technically, the behavior of op<(optional<T>,T) is well-defined
> and consistent with the conceptual model of optional. However, every
> practical use case I have seen so far is a programmer bug.

I personally have to disagree with the statement... I find your
readiness to immediately promote T to optional<T> unreasonable. If you
have that functionality, it does not mean you apply it it left and right
and think it's the right thing to do. The behavior you actually
described as "well-defined" is of op<(optional<T>, optional<T>)... the
behavior of which is indeed well-defined... even though where to put
"nothing" value is arguable in its own right.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk