CARB_FATAL_UNLESS#

Defined in carb/Defines.h

CARB_FATAL_UNLESS(cond, fmt, ...)#

Terminates the application if a check fails.

The implementation can be overridden on the command line, or by defining to a different implementation before including this file.

When cond is evaluated as false, the assertion is dispatched. If g_carbAssert is non-nullptr, the carb::assert::IAssert::reportFailedAssertion2 function is called with carb::assert::Type::eFatal. This causes vectored assertion handlers to run. If g_carbAssert is nullptr, the assertion information is printed to stderr. If the assert handler returns, is called.

See the main assert article .

Warning

Undefined behavior occurs if an overriding implementation of CARB_FATAL_UNLESS allows continued execution when cond returns false.

Parameters:
  • cond – A condition that is evaluated for a boolean result. If the condition produces false, the assert handler is notified. If the assert handler returns, std::terminate() is called.

  • fmt – An explanation of the failure is required. This is a printf-style format string.

  • ... – printf-style variadic parameters