Skip to content

Instantly share code, notes, and snippets.

@acmorrow
Created January 21, 2013 21:09
Show Gist options
  • Save acmorrow/4589420 to your computer and use it in GitHub Desktop.
Save acmorrow/4589420 to your computer and use it in GitHub Desktop.
error_or: getLastError example
// 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