Base class for all exceptions.
| 37 | |
| 38 | /// Base class for all exceptions. |
| 39 | struct Exception: virtual std::exception, virtual boost::exception |
| 40 | { |
| 41 | Exception(std::string _message = std::string()): m_message(std::move(_message)) {} |
| 42 | const char* what() const noexcept override { return m_message.empty() ? std::exception::what() : m_message.c_str(); } |
| 43 | |
| 44 | private: |
| 45 | std::string m_message; |
| 46 | }; |
| 47 | |
| 48 | #define DEV_SIMPLE_EXCEPTION(X) struct X: virtual Exception { const char* what() const noexcept override { return #X; } } |
| 49 |
no outgoing calls