#include <cstdlib>
#include <type_traits>
#include <utility>
Go to the source code of this file.
#define DENSITY_ASSERT |
( |
|
... | ) |
((void)(0)) |
Assert used to detect user errors that causes undefined behavior
#define DENSITY_ASSERT_INTERNAL |
( |
|
... | ) |
((void)(0)) |
Assert used to detect bugs of the library that causes undefined behavior
#define DENSITY_ASSUME |
( |
|
bool_expr, |
|
|
|
... |
|
) |
| (void)0 |
Macro that tells an invariant to the compiler as hint for the optimizer.
#define DENSITY_ASSUME_ALIGNED |
( |
|
address, |
|
|
|
constexpr_alignment |
|
) |
| DENSITY_ASSUME((uintptr_t(address) & ((constexpr_alignment)-1)) == 0) |
Macro used to enforce the alignment of a pointer as an invariant.
#define DENSITY_LIKELY |
( |
|
bool_expr | ) |
(bool_expr) |
Macro that tells to the compiler that a condition is true in most cases. This is just an hint to the optimizer.
#define DENSITY_NO_INLINE |
Macro used in some circumstances to avoid inlining of a function, for example because the call handles a somewhat rare slow path.
#define DENSITY_CHECKING_ASSERT |
( |
|
bool_expr, |
|
|
|
... |
|
) |
| (!(bool_expr) ? std::abort() : (void)0) |
Assert that on failure should cause an halt of the program. Used only locally in this header.