Set up macros for easier exception throwing.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a64c2aaca8
commit
a665ad3eaf
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue