Boost logo

Boost :

Subject: Re: [boost] [optional] operator<(optional<T>, T) -- is it wrong?
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2014-11-25 22:20:01

On Tue, Nov 25, 2014 at 5:27 PM, Edward Diener <eldiener_at_[hidden]>

> On 11/25/2014 7:18 PM, Vicente J. Botet Escriba wrote:
>> Following your reasoning, I will suggest to remove the implicit
>> construction from T to optional<T> and/or remove the
>> operator<(optional<T>, optional<>). If we can not live without them, we
>> could always try to do whatever is better.
> I do not understand why anyone feels that the less than operator for
> boost::optional<T> is wrong.

I can MAYBE see not having them as long as std::less and family are still
specialized accordingly (specializing std::less is [correctly, IMO] in for
the proposed standard optional now anyway, thanks to Tony Van Eerd).
Ultimately, though, I really don't think there's a problem with also having
the operators overloaded. I simply don't buy the "gotchas."

-Matt Calabrese

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