MT Core (C++)
Core library for replacing C++ standard in project usage
|
Macros. More...
Macros | |
#define | EXIT_MAX 255 |
Maximum exit code value. | |
#define | EXIT_ABORT EXIT_MAX |
Exit code value to indicate program was aborted due to invalid state (e.g. | |
#define | mt_print_cur_stacktrace(...) |
Prints the current stack trace with an optional message. | |
#define | mt_print_stacktrace(TRACE, ...) |
Prints a specific stack trace with an optional message. | |
#define | ensure(check, ...) |
Ensures that a check holds true, aborts the program if not true Will print error if the condition is false. | |
#define | unreachable(...) |
Marks code as unreachable. | |
#define | mtdefer auto DEFER(__LINE__) = mtcore::defer_impl::DeferrerBuilder{} + [&]() |
Defer statement that will mtdefer execution until the scope is left, at which point the code will run Execution will happen regardless of whether there was an error. | |
Macros.
#define ensure | ( | check, | |
... ) |
Ensures that a check holds true, aborts the program if not true Will print error if the condition is false.
check | The Check to ensure is true |
Definition at line 216 of file core/mtcore/core.hpp.
#define EXIT_ABORT EXIT_MAX |
Exit code value to indicate program was aborted due to invalid state (e.g.
failed ensure)
Definition at line 134 of file core/mtcore/core.hpp.
#define EXIT_MAX 255 |
Maximum exit code value.
Definition at line 126 of file core/mtcore/core.hpp.
#define mt_print_cur_stacktrace | ( | ... | ) |
Prints the current stack trace with an optional message.
Definition at line 146 of file core/mtcore/core.hpp.
#define mt_print_stacktrace | ( | TRACE, | |
... ) |
Prints a specific stack trace with an optional message.
Definition at line 163 of file core/mtcore/core.hpp.
#define mtdefer auto DEFER(__LINE__) = mtcore::defer_impl::DeferrerBuilder{} + [&]() |
Defer statement that will mtdefer execution until the scope is left, at which point the code will run Execution will happen regardless of whether there was an error.
Example Usage:
Definition at line 357 of file core/mtcore/core.hpp.
#define unreachable | ( | ... | ) |
Marks code as unreachable.
If hit, will crash the program
Definition at line 246 of file core/mtcore/core.hpp.