fisher/MyException.h
2024-09-16 13:18:17 +02:00

17 lines
393 B
C++
Executable File

#ifndef MYEXCEPTION_H
#define MYEXCEPTION_H
#include <sstream>
#define MYEXCEPTION(msg) MyException(msg, __FILE__, __LINE__)
inline void MyException(const std::string& msg,
char* file,
unsigned line){
std::stringstream ss;
ss << msg << " at " << file << ":" << line;
throw std::runtime_error(ss.str());
}
#endif // MYEXCEPTION_H