Created
January 21, 2013 21:09
-
-
Save acmorrow/4589420 to your computer and use it in GitHub Desktop.
error_or: getLastError example
This file contains hidden or 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
// GetLastError is no better | |
Foo* makeAFoo(int param1, int param2) | |
Foo* newFoo = makeAFoo(42, 0); | |
// Easy to forget to call this... | |
Status s = getLastError(); | |
if (s) { | |
newFoo->doSomething(); | |
} else { | |
// handle Error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment