Open shua27 opened 6 years ago
Thanks @shua27,
I'm in the process of updating expected lite to the latest proposal, p0323R6, see issue #20 (*)
IIUC, p0323R6's section Expected Equality operators [expected.equality_op] describes the behavior you propose.
(*) Be it sidetracked a bit to gsl-lite, span-lite and status_value.
When attempting to compare expected objects specialized with a void value type, I get the following error during compilation:
Obviously this wouldn't compile as you can't compare as the void specialization of expected doesn't (can't) have an implementation of
operator*
.Currently, the behavior of the
operator==
whenT
is not void is such that the values are compared if a value exists, else just the truthiness is compared, which makes sense. Reference.Extending this logic to the void specialization would just require comparing the truthiness of the object, as all void expected objects should be equal:
Is there a reason why the equality operator hasn't been implemented for the void specialization?