tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
assert.hpp File Reference

Go to the source code of this file.

Classes

struct  assert_msg
 Payload for an assertion. More...
 

Namespaces

namespace  etl
 

Macros

#define TETL_ASSERT(...)
 
#define TETL_ASSERT_IMPL(...)
 

Functions

template<typename Assertion>
auto assert_handler (Assertion const &msg) -> void
 
auto exit (int) -> void
 

Macro Definition Documentation

◆ TETL_ASSERT

#define TETL_ASSERT ( ...)
Value:
TETL_ASSERT_IMPL(__VA_ARGS__)
#define TETL_ASSERT_IMPL(...)
Definition assert.hpp:49

◆ TETL_ASSERT_IMPL

#define TETL_ASSERT_IMPL ( ...)
Value:
do { \
if (not(__VA_ARGS__)) [[unlikely]] { \
/* TETL_DEBUG_TRAP(); */ \
etl::assert_handler(etl::assert_msg{ \
.line = __LINE__, \
.file = __FILE__, \
.func = etl::is_hosted() ? TETL_BUILTIN_FUNCTION() : nullptr, \
.expression = etl::is_hosted() ? TETL_STRINGIFY((__VA_ARGS__)) : nullptr, \
}); \
} \
} while (false)
#define TETL_BUILTIN_FUNCTION()
Definition builtin_functions.hpp:27
Definition adjacent_find.hpp:8
consteval auto is_hosted() noexcept -> bool
Definition implementation.hpp:19
#define TETL_STRINGIFY(str)
Definition preprocessor.hpp:27
Payload for an assertion.
Definition assert.hpp:21

Function Documentation

◆ exit()

auto exit ( int ) -> void
inline
Examples
cassert.cpp.