Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <exception>
- #include <iostream>
- #include <string>
- using namespace std;
- class
- //__attribute__((visibility("hidden")))
- MyException : public exception
- {
- private:
- string __text;
- public:
- MyException( const string& text ) : exception(), __text(text) { }
- virtual ~MyException() throw() { }
- virtual const char* what() const throw() { return __text.c_str(); }
- };
- void
- doit()
- {
- cout << __PRETTY_FUNCTION__ << endl;
- throw MyException("interesting");
- }
Add Comment
Please, Sign In to add comment