2018-01-22 19:31 GMT-03:00 Gavin Lambert via Boost
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/