Corrade/Utility/DebugAssert.h file new in Git master

Macro CORRADE_DEBUG_ASSERT(), CORRADE_CONSTEXPR_DEBUG_ASSERT(), CORRADE_DEBUG_ASSERT_OUTPUT(), CORRADE_INTERNAL_DEBUG_ASSERT(), CORRADE_INTERNAL_CONSTEXPR_DEBUG_ASSERT(), CORRADE_INTERNAL_DEBUG_ASSERT_OUTPUT(), CORRADE_DEBUG_ASSERT_UNREACHABLE(), CORRADE_INTERNAL_DEBUG_ASSERT_UNREACHABLE()

Variants of asserts from Corrade/Utility/Assert.h that get checked only in debug builds. They live in a separate header to avoid release builds unnecessarily pulling in debug output and other dependencies of regular asserts.

Namespaces

namespace Corrade
Root namespace.
namespace Corrade::Utility
Utitlities.

Defines

#define CORRADE_DEBUG_ASSERT(condition, message, returnValue) new in Git master
Debug assertion macro.
#define CORRADE_CONSTEXPR_DEBUG_ASSERT(condition, message) new in Git master
Constexpr debug assertion macro.
#define CORRADE_DEBUG_ASSERT_OUTPUT(call, message, returnValue) new in Git master
Call output debug assertion macro.
#define CORRADE_DEBUG_ASSERT_UNREACHABLE(message, returnValue) new in Git master
Debug assert that the code is unreachable.
#define CORRADE_INTERNAL_DEBUG_ASSERT(condition) new in Git master
Internal debug assertion macro.
#define CORRADE_INTERNAL_CONSTEXPR_DEBUG_ASSERT(condition) new in Git master
Internal constexpr debug assertion macro.
#define CORRADE_INTERNAL_DEBUG_ASSERT_OUTPUT(call) new in Git master
Internal call output debug assertion macro.
#define CORRADE_INTERNAL_DEBUG_ASSERT_EXPRESSION(...) new in Git master
Internal expression debug assertion macro.
#define CORRADE_INTERNAL_DEBUG_ASSERT_UNREACHABLE() new in Git master
Internal debug assert that the code is unreachable.

Define documentation

#define CORRADE_DEBUG_ASSERT(condition, message, returnValue) new in Git master

Debug assertion macro.

Expands to CORRADE_ASSERT() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to do {} while(false).

You can override this implementation by placing your own #define CORRADE_DEBUG_ASSERT before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_CONSTEXPR_DEBUG_ASSERT(condition, message) new in Git master

Constexpr debug assertion macro.

Expands to CORRADE_CONSTEXPR_ASSERT() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to static_cast<void>(0).

You can override this implementation by placing your own #define CORRADE_CONSTEXPR_DEBUG_ASSERT before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_DEBUG_ASSERT_OUTPUT(call, message, returnValue) new in Git master

Call output debug assertion macro.

Expands to CORRADE_ASSERT_OUTPUT() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to static_cast<void>(call).

You can override this implementation by placing your own #define CORRADE_DEBUG_ASSERT_OUTPUT before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_DEBUG_ASSERT_UNREACHABLE(message, returnValue) new in Git master

Debug assert that the code is unreachable.

Expands to CORRADE_ASSERT_UNREACHABLE() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to a compiler builtin on GCC, Clang and MSVC; calls std::abort() otherwise. A return statement can thus be safely omitted in a code path following this macro even in a release build without causing any compiler warnings or errors.

You can override this implementation by placing your own #define CORRADE_DEBUG_ASSERT_UNREACHABLE before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_INTERNAL_DEBUG_ASSERT(condition) new in Git master

Internal debug assertion macro.

Expands to CORRADE_INTERNAL_ASSERT() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to do {} while(false).

You can override this implementation by placing your own #define CORRADE_INTERNAL_DEBUG_ASSERT before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_INTERNAL_CONSTEXPR_DEBUG_ASSERT(condition) new in Git master

Internal constexpr debug assertion macro.

Expands to CORRADE_INTERNAL_CONSTEXPR_ASSERT() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to static_cast<void>(0).

You can override this implementation by placing your own #define CORRADE_INTERNAL_CONSTEXPR_DEBUG_ASSERT before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_INTERNAL_DEBUG_ASSERT_OUTPUT(call) new in Git master

Internal call output debug assertion macro.

Expands to CORRADE_INTERNAL_ASSERT_OUTPUT() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to static_cast<void>(call).

You can override this implementation by placing your own #define CORRADE_INTERNAL_DEBUG_ASSERT_OUTPUT before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_INTERNAL_DEBUG_ASSERT_EXPRESSION(...) new in Git master

Internal expression debug assertion macro.

Expands to CORRADE_INTERNAL_ASSERT_EXPRESSION() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to nothing, leaving just the parenthesized expression out of it.

You can override this implementation by placing your own #define CORRADE_INTERNAL_DEBUG_ASSERT_EXPRESSION before including the Corrade/Utility/DebugAssert.h header.

#define CORRADE_INTERNAL_DEBUG_ASSERT_UNREACHABLE() new in Git master

Internal debug assert that the code is unreachable.

Expands to CORRADE_INTERNAL_ASSERT_UNREACHABLE() if CORRADE_NO_ASSERT is not defined and either CORRADE_IS_DEBUG_BUILD is defined or NDEBUG is not defined. Otherwise expands to a compiler builtin on GCC, Clang and MSVC; calls std::abort() otherwise. A return statement can thus be safely omitted in a code path following this macro even in a release build without causing any compiler warnings or errors.

You can override this implementation by placing your own #define CORRADE_INTERNAL_DEBUG_ASSERT_UNREACHABLE before including the Corrade/Utility/DebugAssert.h header.