Guest User

Untitled

a guest
Jul 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <exception>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. class
  8. //__attribute__((visibility("hidden")))
  9. MyException : public exception
  10. {
  11. private:
  12. string __text;
  13. public:
  14. MyException( const string& text ) : exception(), __text(text) { }
  15. virtual ~MyException() throw() { }
  16. virtual const char* what() const throw() { return __text.c_str(); }
  17. };
  18.  
  19. void
  20. doit()
  21. {
  22. cout << __PRETTY_FUNCTION__ << endl;
  23. throw MyException("interesting");
  24. }
Add Comment
Please, Sign In to add comment