Macro Subspace :: sus_panic_with_message

Terminate the program, after printing a message.

The default behaviour of this function is to abort(). The behaviour of this function can be overridden by defining a SUS_PROVIDE_PANIC_HANDLER() macro when compiling the library.

The panic message will be printed to stderr before aborting. This behaviour can be overridden by defining a SUS_PROVIDE_PRINT_PANIC_MESSAGE_HANDLER() macro when compiling the library. The SUS_PROVIDE_PRINT_PANIC_MESSAGE_HANDLER() macro receives two arguments:

  • A message, which is a const char*, a std::string_view or a std::string. Overloads should be used to handle each case.
  • A PanicLocation. If the SUS_PROVIDE_PRINT_PANIC_MESSAGE_HANDLER macro does not consume the msg, this macro will avoid instantiating it at all.