Guest User

Untitled

a guest
Jan 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. throw my_exception() << "The error " << error_code << " happened because of " << reasons;
  2.  
  3. class my_exception
  4. {
  5. public:
  6. template <typename T>
  7. my_exception & operator << (const T & value)
  8. {
  9. // put the value somewhere
  10. return *this;
  11. }
  12. // etc.
  13. };
  14.  
  15. std::stringstream s;
  16. s << "The error " << error_code << " happened because of " << reasons;
  17. throw my_exception(s.str());
Add Comment
Please, Sign In to add comment