| 38 | { |
| 39 | |
| 40 | class exception : public std::exception |
| 41 | { |
| 42 | public: |
| 43 | explicit exception(const char *message) : message(message) {} |
| 44 | explicit exception(std::string message) : message(std::move(message)) {} |
| 45 | const char *what() const noexcept override { return message.c_str(); } |
| 46 | |
| 47 | private: |
| 48 | // This function exists to 'anchor' the class, and stop the compiler from |
| 49 | // copying vtable and RTTI info into every object file that includes |
| 50 | // this header. (Caught by -Wweak-vtables under Clang.) |
| 51 | virtual void anchor() const; |
| 52 | const std::string message; |
| 53 | }; |
| 54 | |
| 55 | /** |
| 56 | * Indicates a class of error that occurred that was caused by some kind of |
no outgoing calls
no test coverage detected