Skip to content

Instantly share code, notes, and snippets.

@EricWF
Created May 5, 2017 23:35
Show Gist options
  • Save EricWF/b637eab244247a38f8d0908037fb0416 to your computer and use it in GitHub Desktop.
Save EricWF/b637eab244247a38f8d0908037fb0416 to your computer and use it in GitHub Desktop.
#include <exception>
#ifdef NDEBUG
#undef NDEBUG
#endif
#include <cassert>
int main() {
std::exception_ptr p2;
try {
throw 42;
} catch (...) {
auto p = std::current_exception();
p2 = std::current_exception();
assert(p == p2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment