Created
September 12, 2014 19:45
-
-
Save bholt/42a4895c159623d9ef66 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
template< typename T > | |
void work(T t) { | |
try { throw t; } | |
catch (int x) { printf("int\n"); } | |
catch (std::string x) { printf("string\n"); } | |
} | |
int main(int argc, char *argv[]) { | |
work(0); | |
work(std::string("foo")); | |
return 0; | |
} | |
///////////////////////////////////////////////////////////// | |
//> int | |
//> string | |
///////////////////////////////////////////////////////////// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment