Subject: Re: [boost] [outcome] comments on Regular ops
From: VinÃcius dos Santos Oliveira (vini.ipsmaker_at_[hidden])
Date: 2018-01-24 17:11:45
2018-01-22 19:31 GMT-03:00 Gavin Lambert via Boost <boost_at_[hidden]>:
> On 23/01/2018 03:53, Niall Douglas wrote:
>> My recommendation would be not to provide comparison operators if either
>>> `T` or `EC` does not provide them.
>> Agreed. Logged to https://github.com/ned14/outcome/issues/107
> I assume this would be individually for each case?
> There is still benefit in providing operator==(EC) even if T does not
> provide operator==, eg. for the construct:
> if (outcome == make_error_code(xxx))
> (not sure if this is the exact spelling, but it's something like this)
> Especially in generic code templated on T. The alternative is much more
> wordy and not really any clearer.
By alternative do you mean the following?
if (outcome.error() == make_error_code(xxx))
I don't find it that much verbose and prefer to stick to Andrzej's
suggestion on only providing these operators conditionally.
-- VinÃcius dos Santos Oliveira https://vinipsmaker.github.io/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk