32#if defined(__cplusplus) && __cplusplus >= 201703L
33#define IRSOL_MAYBE_UNUSED [[maybe_unused]]
34#elif defined(__GNUC__) || defined(__clang__)
35#define IRSOL_MAYBE_UNUSED __attribute__((unused))
36#elif defined(_MSC_VER)
37#define IRSOL_MAYBE_UNUSED
39#define IRSOL_MAYBE_UNUSED
59#if defined(__GNUC__) || defined(__clang__)
60#ifndef IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START
61#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START \
62 _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wunused-variable\"")
64#ifndef IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_END
65#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_END _Pragma("GCC diagnostic pop")
68#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START
69#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_END
79#if defined(__GNUC__) || defined(__clang__)
80#define _IRSOL_UNREACHABLE_IMPL() __builtin_unreachable()
81#elif defined(_MSC_VER)
82#define _IRSOL_UNREACHABLE_IMPL() __assume(false)
84#define _IRSOL_UNREACHABLE_IMPL() \
107#define IRSOL_UNREACHABLE() _IRSOL_UNREACHABLE_IMPL()
129#ifndef IRSOL_STATIC_UNREACHABLE
130#define IRSOL_STATIC_UNREACHABLE(messageLiteral) \
131 IRSOL_STATIC_ASSERT( \
132 (irsol::traits::always_false<struct _irsol_dependent_false_>::value), \
133 "Unreachable constexpr code triggered: " messageLiteral); \
134 _IRSOL_UNREACHABLE_IMPL()
147#ifndef _IRSOL_STATIC_ASSERT_MISSING_TEMPLATE_SPECIALIZATION
148#define _IRSOL_STATIC_ASSERT_MISSING_TEMPLATE_SPECIALIZATION(T, messageLiteral) \
149 IRSOL_STATIC_ASSERT((irsol::traits::always_false<T>::value), messageLiteral)
172#ifndef IRSOL_MISSING_TEMPLATE_SPECIALIZATION
173#define IRSOL_MISSING_TEMPLATE_SPECIALIZATION(T, funcNameLiteral) \
174 _IRSOL_STATIC_ASSERT_MISSING_TEMPLATE_SPECIALIZATION( \
176 "Function '" funcNameLiteral "' lacks a template specialization for this type. " \
177 "Please ensure you handle all required template types explicitly.")
Assertion macros and utilities based on the PPK_ASSERT library.
Template metaprogramming traits for type introspection in the irsol library.