Skip to content

Instantly share code, notes, and snippets.

@wilhelmtell
Created October 31, 2010 13:09
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 wilhelmtell/656567 to your computer and use it in GitHub Desktop.
Save wilhelmtell/656567 to your computer and use it in GitHub Desktop.
try {
std::vector<int> v;
// gtfo of try, so we only catch the ctor's error
} catch (const std::bad_alloc& e) {
// ...
}
// damn it, so now v's out of scope!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment