Created
May 5, 2017 23:35
-
-
Save EricWF/b637eab244247a38f8d0908037fb0416 to your computer and use it in GitHub Desktop.
This file contains 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
#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