#ifndef EXCEPTIONS #define EXCEPTIONS #include /** * Generic Exception class */ class RuntimeException { private: std::string errorMsg; public: RuntimeException(const std::string& err) { errorMsg = err; } std::string getMessage() const { return errorMsg; } }; inline std::ostream& operator<<(std::ostream& out, const RuntimeException& e) { return out << e.getMessage(); } /** * Exception thrown on performing min operations on empty priority queue. */ class EmptyContainerException : public RuntimeException { public: EmptyContainerException(const std::string& err) : RuntimeException(err) {} }; #endif