Skip to content

Instantly share code, notes, and snippets.

@Jon889
Created April 5, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jon889/502d6bad706632ff414e521cfbc2ea49 to your computer and use it in GitHub Desktop.
Save Jon889/502d6bad706632ff414e521cfbc2ea49 to your computer and use it in GitHub Desktop.
template <class A> struct Failable
{
bool error;
A value;
wxString errorString;
Failable(wxString errorStr) : error(true), errorString(errorStr) {}
Failable(A val) : error(false), value(val) {}
operator A() const { return value; }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment