Subject: Re: [boost] [optional] operator<(optional<T>, T) -- is it wrong?
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2014-11-25 19:18:05
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.