Skip to content

Engine → Core

assert.h

Assertions.

Structs

File Description
assert_info Everything known about a failed assertion.

Enumerations

assert_action

enum class assert_action : u8 {
    BREAK,      // break into the debugger (or trap when none is attached)
    CONTINUE,   // carry on as if the assertion passed
    ABORT       // terminate the process
};

What the program does after the handler returns.

Type Aliases

assert_handler

using assert_handler = assert_action (*)(const assert_info &info);

Functions

Public

current_assert_handler

[[nodiscard]] CONJURE_API assert_handler current_assert_handler() noexcept;

The handler currently in effect.

default_assert_handler

CONJURE_API assert_action default_assert_handler(
    const assert_info &info);

The built-in handler: logs the failure and asks to break.

detail::format_assert_message

inline std::string format_assert_message();
template <typename... Args> std::string format_assert_message(std::format_string<Args...> format, Args &&...args);

detail::report_assert_failure

CONJURE_API bool report_assert_failure( const char *expression, const char *file, int line, const char *function, std::string message );

Reports a failure to the active handler. Returns true when the caller should break.

set_assert_handler

CONJURE_API assert_handler set_assert_handler(
    assert_handler handler) noexcept;

Installs a new assertion handler and returns the previous one. Pass nullptr to restore the default handler, which logs the failure and breaks.