hyperion::assert#
hyperion::assert is a C++20 library for all manner of runtime assertions. It includes assertions for verifying contract requirements (i.e. pre-conditions, post-conditions), assertions for verifying error conditions have not occurred, debug assertions, optimization suggestions, and more, all with stacktrace support, user-configurable handling, optional syntax highlighting, and expression decomposition.
Example#
1#include <hyperion/assert.h>
2
3auto example() {
4 const auto lambda = []() {
5 return 4;
6 };
7 HYPERION_ASSERT_DEBUG(2 + lambda() == 7, "lambda() wasn't {}", 5);
8}
See the Quick Start Guide for how to get started using hyperion::assert.
For an overview of each module, see the links in the left sidebar or below.
Getting Started
Quick Reference
Assertions
- hyperion::assert
- hyperion::assert::backtrace
- hyperion::assert::highlight
- hyperion::assert::panic
- hyperion::assert::tokens
IdentifierKindhyperion::assert::tokens::Namespacehyperion::assert::tokens::Typehyperion::assert::tokens::Functionhyperion::assert::tokens::Variablehyperion::assert::tokens::Keywordhyperion::assert::tokens::Stringhyperion::assert::tokens::Numerichyperion::assert::tokens::Punctuationhyperion::assert::tokens::Error
HYPERION_ASSERT_ASSUMEHYPERION_ASSERT_DEBUGHYPERION_ASSERT_PRECONDITIONHYPERION_ASSERT_POSTCONDITIONHYPERION_ASSERT_REQUIREHYPERION_ASSERT_FATALHYPERION_ASSERT_EXPECTHYPERION_ASSERT_UNEXPECTHYPERION_ASSERT_DEBUG_BREAKHYPERION_ATTRIBUTE_COLDHYPERION_ATTRIBUTE_NO_INLINE