#ifndef LAGSHTEXCEPTIONS_SEEN #define LAGSHTEXCEPTIONS_SEEN #include #include namespace LagSHT { class LagSHTError : public std::exception { public: explicit LagSHTError(const std::string& m) : msg_(m) { } explicit LagSHTError(const char* m): msg_(m) { } virtual ~LagSHTError() throw() {} //! Implementation of std::exception what() method, returning the exception message virtual const char* what() const throw() { return msg_.c_str(); } private: std::string msg_; };//LagSHTError #define lagsht_assert(testval,msg) \ do { if (testval); else throw LagSHTError(msg); } while(0) }//end namespace #endif //LAGSHTEXCEPTIONS_SEEN