Skip to content

AUI_ASSERT#

Asserts that the passed condition evaluates to true.

Header:#include <AUI/Util/Assert.h>
CMake:aui_link(my_target PUBLIC aui::core)

Definition#

#define AUI_ASSERT(condition) AUI_IMPL_ASSERT(condition)

Detailed Description#

If the condition evaluates to false, triggers default C++ assert behavior (that is, program termination) on debug build or throws AAssertionFailedException on release builds, so it can be handled and reported properly in production applications.

Examples#

examples/7guis/cells/src/AST.cpp

7GUIs Cells - Spreadsheet processor (Excel).

                    .op = out.get(),
                    .priority = currentPriority,
                    .owning = std::move(out),
                };
                AUI_ASSERT(temporaryValue == nullptr);
                return;
            }

            for (const auto& o : binaryOperators | ranges::views::reverse) {
                if (o.priority < currentPriority && o.op->right) {

Examples#