Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad implementation of outcome::operator== #116

Closed
akrzemi1 opened this issue Jan 26, 2018 · 2 comments
Closed

Bad implementation of outcome::operator== #116

akrzemi1 opened this issue Jan 26, 2018 · 2 comments
Assignees
Labels

Comments

@akrzemi1
Copy link
Collaborator

Errored and valued outcomes compare equal:

#include "outcome.hpp"
namespace out = OUTCOME_V2_NAMESPACE;

int main()
{    
  out::outcome<int> o1 = 1;
  assert (!o1.has_error());
    
  out::outcome<int> o2 = out::failure(std::error_code{EINVAL, std::generic_category()});
  assert (o2.has_error());
    
  assert (o1 == o2);
}
@ned14 ned14 added the bug label Jan 28, 2018
@ned14 ned14 added this to the Outcome v2 review milestone Jan 28, 2018
@ned14
Copy link
Owner

ned14 commented Jan 28, 2018

I wouldn't be surprised. Implementing issue #107 will fix this. Thanks for the bug report.

@ned14 ned14 self-assigned this Mar 22, 2018
ned14 added a commit that referenced this issue Mar 22, 2018
…if the value, error and

exception types do not implement the same operator.
- Bug #116 Relatedly, both comparison operators simple didn't work right. Fixed.
@ned14
Copy link
Owner

ned14 commented Mar 22, 2018

Fixed

@ned14 ned14 closed this as completed Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants