...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <exception> #include <iostream> struct S : std::exception { const char *what() const noexcept override { return "My custom exception"; } }; void f() { try { S s; throw S()&s; } catch (std::exception* e) { std::cout << e.what->what() << std::endl; } } |
Compliant Solution
...