Clustering
C++20 header-only: DBSCAN, HDBSCAN, k-means.
Loading...
Searching...
No Matches
always_assert.h File Reference
#include <cstdio>
#include <cstdlib>
Include dependency graph for always_assert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  clustering

Macros

#define CLUSTERING_ALWAYS_ASSERT(cond)
 Release-active assertion: evaluates cond in every build configuration.

Functions

void clustering::alwaysAssertFail (const char *cond, const char *file, int line) noexcept
 Emits a diagnostic to stderr and terminates via std::abort.

Macro Definition Documentation

◆ CLUSTERING_ALWAYS_ASSERT

#define CLUSTERING_ALWAYS_ASSERT ( cond)
Value:
do { \
if (!(cond)) { \
::clustering::alwaysAssertFail(#cond, __FILE__, __LINE__); \
} \
} while (0)

Release-active assertion: evaluates cond in every build configuration.

Unlike assert, this check survives -DNDEBUG. Use it at public API entry points whose failure would corrupt memory or trigger undefined behavior past the debug boundary – writes through a read-only borrow, null output buffers, etc.

Definition at line 30 of file always_assert.h.