Created
January 14, 2019 10:04
-
-
Save philsquared/567fdd233d574fe1957d17aff3e5d02c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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