|
K-HHC
C++ Header-only Library for Hexahexacontadecimal Encoding/Decoding
|
#include <cstdlib>#include <iostream>

Go to the source code of this file.
Namespaces | |
| namespace | hhc |
| namespace | hhc::detail |
Macros | |
| #define | HHC_NO_PROFILE |
| #define | HHC_HAVE_BACKTRACE 0 |
| #define | HHC_HAVE_STACKWALK 0 |
| #define | HHC_ASSERT(expr) |
| HHC assertion macro. | |
| #define | HHC_ASSERT_MSG(expr, msg) |
| HHC assertion macro with custom message. | |
| #define | HHC_UNREACHABLE(msg) |
| Mark a code path as unreachable. | |
Functions | |
| void | hhc::detail::flush_coverage_profile () |
| HHC_NO_PROFILE void | hhc::detail::print_stack_trace () |
| Print stack trace (debug builds only) | |
| HHC_NO_PROFILE void | hhc::detail::assertion_failed (const char *expression, const char *file, const int line, const char *function) |
| Handle assertion failure. | |
| #define HHC_ASSERT | ( | expr | ) |
HHC assertion macro.
Unlike standard assert(), this macro:
Use this for conditions that should NEVER be false. If they are, it indicates a critical bug in the library code.
Example: HHC_ASSERT(pointer != nullptr);
| expr | The expression to check (must evaluate to true) |
| #define HHC_ASSERT_MSG | ( | expr, | |
| msg | |||
| ) |
HHC assertion macro with custom message.
Same as HHC_ASSERT but allows a custom error message.
Example: HHC_ASSERT_MSG(size > 0, "Size must be positive");
| expr | The expression to check |
| msg | Custom error message (string literal) |
| #define HHC_HAVE_BACKTRACE 0 |
| #define HHC_HAVE_STACKWALK 0 |
| #define HHC_NO_PROFILE |
| #define HHC_UNREACHABLE | ( | msg | ) |
Mark a code path as unreachable.
Use this for code paths that should never be reached. In debug: aborts with error message In release: generates trap instruction (optimization hint)
Example: switch (value) { case 1: return foo(); case 2: return bar(); default: HHC_UNREACHABLE("Invalid value"); }
| msg | Explanation of why this should be unreachable |