|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
Function-like class for assertions that is expected to be used via the deduction guide as: More...
#include <debug.hh>
Public Member Functions | |
| template<typename T> requires DebugConcepts::IsBool<T> | |
| Assert (T condition, const char *fmt, Args... args, SourceLocation loc=SourceLocation::current()) | |
| Constructor, performs the assertion check. | |
| template<typename T> requires DebugConcepts::LazyAssertion<T> | |
| Assert (T &&condition, const char *fmt, Args... args, SourceLocation loc=SourceLocation::current()) | |
| Constructor, performs an assertion check. | |
Function-like class for assertions that is expected to be used via the deduction guide as:
ConditionalDebug::Assert(someCondition, "A message...", ...);
Assertions are checked only if EnableAssertions is true (by default, if the threshold is lower than or equal to Warning).
|
inline |
Constructor, performs the assertion check.
Definition at line 935 of file debug.hh.
References anonymous_namespace{debug.hh}::SourceLocation::current(), and anonymous_namespace{debug.hh}::ConditionalDebug< Threshold, Context, EnableAssertions, VerboseInvariants >::report_failure().
|
inline |
Constructor, performs an assertion check.
This version is passed a lambda that returns a bool, rather than a boolean condition. This allows the compiler to completely elide the contents of the lambda in builds where this component is not being debugged. This version should be used for places where the assertion condition has side effects.
Definition at line 967 of file debug.hh.
References anonymous_namespace{debug.hh}::SourceLocation::current(), and anonymous_namespace{debug.hh}::ConditionalDebug< Threshold, Context, EnableAssertions, VerboseInvariants >::report_failure().