Set up macros for easier exception throwing.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-08-17 12:02:42 +02:00
parent a64c2aaca8
commit a665ad3eaf
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 10 additions and 1 deletions

View File

@ -121,4 +121,13 @@ namespace ArbUt {
}; };
} }
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#define THROW(message) \
std::stringstream ___ss; \
___ss << "[" << __FILENAME__ << ":" << __LINE__ << "] " << message; \
throw ArbUt::Exception(___ss.str());
#define NOT_REACHABLE THROW("Not reachable");
#define NOT_IMPLEMENTED THROW("Not implemented");
#endif // ARBUTILS_EXCEPTION_HPP #endif // ARBUTILS_EXCEPTION_HPP