diff options
-rw-r--r-- | Exception.cpp | 3 | ||||
-rw-r--r-- | Exception.h | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Exception.cpp b/Exception.cpp index 52e30dc..c6dd60b 100644 --- a/Exception.cpp +++ b/Exception.cpp @@ -2,6 +2,7 @@ #include <cstdarg> #include <cstdio> +#include <cstdlib> Exception::Exception(const char * fmt, ...) { va_list args; @@ -20,4 +21,4 @@ Exception::~Exception() { const char * Exception::what() { return error; -}
\ No newline at end of file +} diff --git a/Exception.h b/Exception.h index 818f3f0..ef45522 100644 --- a/Exception.h +++ b/Exception.h @@ -12,5 +12,12 @@ private: char * error = NULL; }; -class ParserException : public Exception { using Exception::Exception; }; -class CircuitException : public Exception { using Exception::Exception; }; +class ParserException : public Exception { +public: + ParserException(const char * fmt, ...) : Exception(fmt) {} +}; + +class CircuitException : public Exception { +public: + CircuitException(const char * fmt, ...) : Exception(fmt) {} +}; |