Advertisement
militaryCoder

Throwable

May 14th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. class Throwable
  2. {
  3.     private:
  4.     union
  5.     {
  6.         ExceptionOrOtherShitIndicatesError exc;
  7.         SomeValueIndicatesSuccess successCode;
  8.     }
  9.  
  10.     public:
  11.     bool isError() { // Tells if exception is stored in union };
  12.     auto getError() -> ExceptionOrOtherShitIndicatesError {};
  13.     auto getSuccessCode() -> SomeValueIndicatesSuccess {};
  14.  
  15.     static ExceptionOrOtherShitIndicatesError constructError() {};
  16.     static SomeValueIndicatesSuccess createSuccessThrow() {};
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement