Boost logo

Boost :

Subject: Re: [boost] [optional] operator<(optional<T>, T) -- is it wrong?
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-11-25 20:27:42


On 11/25/2014 7:18 PM, Vicente J. Botet Escriba wrote:
> Le 25/11/14 21:13, Vladimir Batov a écrit :
>> On 11/24/2014 09:07 PM, Andrzej Krzemienski wrote:
>>> Anyone else? Would you be affected if operator<(optional<T>, T) is
>>> poisoned? (but operator==(optional<T>, T) remains working)
>>
>> Another *pragmatic* point (probably more relevant for the
>> std::optional variant) is if op<(T, optional<T>) is prohibited now and
>> then later it is decided that decision was wrong (even though I can't
>> possibly see how as it does not take *any* functionality away), then
>> adding it back will not cause any issues. On the contrary, it op<() is
>> allowed to stay now and later it's decided that decision was wrong and
>> op<() is better taken out, then it won't be possible to do... well,
>> much harder anyway as it's be a breaking change.
>>
>>
> 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.


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