#undef PARSE_ERROR_CONSTRUCTOR
/** Exception raised by xbt_enforce, when an assertion is not satisfied */
-#define ASSERTION_ERROR_CONSTRUCTOR \
- template<typename... Args> AssertionError(const char * f, Args... args) \
- : Exception(XBT_THROW_POINT, xbt::string_printf(f, args...)) \
- { \
- }
-
-DECLARE_SIMGRID_EXCEPTION(AssertionError, ASSERTION_ERROR_CONSTRUCTOR);
-#undef ASSERTION_ERROR_CONSTRUCTOR
+DECLARE_SIMGRID_EXCEPTION(AssertionError);
#undef DECLARE_SIMGRID_EXCEPTION
*/
public:
ForcefulKillException() = default;
- explicit ForcefulKillException(const std::string& msg) : msg_(std::string("Actor killed (") + msg + std::string(")."))
- {
- }
+ explicit ForcefulKillException(const std::string& msg) : msg_("Actor killed (" + msg + ").") {}
~ForcefulKillException();
const char* what() const noexcept { return msg_.c_str(); }
static bool try_n_catch(const std::function<void()>& try_block);
private:
- std::string msg_ = std::string("Actor killed.");
+ std::string msg_ = "Actor killed.";
};
} // namespace simgrid