You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 3, 2018. It is now read-only.
When attempting to compare expected objects specialized with a void value type, I get the following error during compilation:
error: no match for ‘operator*’ (operand type is ‘const nonstd::expected<void, CUSTOM_ERROR_CODE>’)
returnbool(x) != bool(y) ? false : bool(x) == false ? true : *x == *y;
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== when T 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: