7#define ALIGATOR_RUNTIME_ERROR(...) \
8 throw ::aligator::RuntimeError( \
9 ::aligator::detail::exception_msg(__FILE__, __LINE__, __VA_ARGS__))
11#define ALIGATOR_DOMAIN_ERROR(msg) \
12 throw std::domain_error( \
13 ::aligator::detail::exception_msg(__FILE__, __LINE__, msg))
15#define ALIGATOR_WARNING(loc, ...) \
16 ::aligator::detail::warning_call(loc, __FUNCTION__, __VA_ARGS__)
20void warning_impl(
const char *loc,
const char *fun, fmt::string_view fstr,
21 fmt::format_args args);
22template <
typename... T>
24 fmt::format_string<T...> fstr, T &&...args) {
25 warning_impl(loc, fun, fstr, fmt::make_format_args(args...));
33 fmt::string_view fstr, fmt::format_args args);
34template <
typename... T>
36 fmt::format_string<T...> fstr, T &&...args) {
38 fmt::make_format_args(args...));
44 explicit RuntimeError(
const std::string &what) : std::runtime_error(what) {}
RuntimeError(const std::string &what)
std::string exception_msg_impl(const char *filename, int lineno, fmt::string_view fstr, fmt::format_args args)
std::string exception_msg(const char *filename, int lineno, fmt::format_string< T... > fstr, T &&...args)
void warning_impl(const char *loc, const char *fun, fmt::string_view fstr, fmt::format_args args)
void warning_call(const char *loc, const char *fun, fmt::format_string< T... > fstr, T &&...args)