Skip to content

Instantly share code, notes, and snippets.

@philsquared
Created January 14, 2019 10:04
Show Gist options
  • Save philsquared/567fdd233d574fe1957d17aff3e5d02c to your computer and use it in GitHub Desktop.
Save philsquared/567fdd233d574fe1957d17aff3e5d02c to your computer and use it in GitHub Desktop.
class SuccessFrom {
const int rc;
public:
SuccessFrom( int rc ) : rc(rc) {}
explicit operator bool() const {
return rc == SUCCESS;
}
friend std::ostream& operator<<( std::ostream& os, SuccessFrom const& result ) {
return os << mdb_strerror(result.rc);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment