10[[noreturn]]
void _throw_invalid_operation_error(
char const *source_file,
int source_line,
std::string message);
11[[noreturn]]
void _throw_math_error(
char const* source_file,
int source_line,
std::string message);
12[[noreturn]]
void _throw_parse_error(
char const* source_file,
int source_line,
std::string message);
14template<
typename... Args>
15[[noreturn]]
void throw_invalid_operation_error(
char const *source_file,
int source_line,
char const *str, Args &&... args) {
16 _throw_invalid_operation_error(source_file, source_line, fmt::format(str, std::forward<Args>(args)...));
19template<
typename... Args>
20[[noreturn]]
void throw_math_error(
char const* source_file,
int source_line,
char const* str, Args&&... args) {
21 _throw_math_error(source_file, source_line, fmt::format(str, std::forward<Args>(args)...));
24template<
typename... Args>
25[[noreturn]]
void throw_parse_error(
char const* source_file,
int source_line,
char const* str, Args&&... args) {
26 _throw_parse_error(source_file, source_line, fmt::format(str, std::forward<Args>(args)...));
29#define TTAURI_THROW_INVALID_OPERATION_ERROR(...) throw_invalid_operation_error(__FILE__, __LINE__, __VA_ARGS__);
30#define TTAURI_THROW_MATH_ERROR(...) throw_math_error(__FILE__, __LINE__, __VA_ARGS__);
31#define TTAURI_THROW_PARSE_ERROR(...) throw_parse_error(__FILE__, __LINE__, __VA_ARGS__);
33#define _parse_assert(x) if (!(x)) { TTAURI_THROW_PARSE_ERROR("{}", #x ); }
34#define _parse_assert2(x, ...) if (!(x)) { TTAURI_THROW_PARSE_ERROR(__VA_ARGS__); }