![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Common portability and diagnostic macros for the irsol library. More...
Go to the source code of this file.
Macros | |
#define | IRSOL_MAYBE_UNUSED |
Suppresses compiler warnings about unused variables or parameters. | |
#define | IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START |
Begins a diagnostic suppression block for unused structured binding variables. | |
#define | IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_END |
Ends a diagnostic suppression block started with IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START. | |
#define | _IRSOL_UNREACHABLE_IMPL() |
Internal macro for compiler-specific unreachable code markers. | |
#define | IRSOL_UNREACHABLE() _IRSOL_UNREACHABLE_IMPL() |
Indicates unreachable code to the compiler. | |
#define | IRSOL_STATIC_UNREACHABLE(messageLiteral) |
Marks unreachable branches in constexpr functions. | |
#define | _IRSOL_STATIC_ASSERT_MISSING_TEMPLATE_SPECIALIZATION(T, messageLiteral) IRSOL_STATIC_ASSERT((irsol::traits::always_false<T>::value), messageLiteral) |
Internal helper to trigger a static assertion when a required template specialization is missing. | |
#define | IRSOL_MISSING_TEMPLATE_SPECIALIZATION(T, funcNameLiteral) |
Emits a compile-time error when no template specialization is available. | |
Common portability and diagnostic macros for the irsol library.
Provides cross-platform macros to suppress unused variable warnings, indicate unreachable code paths, and enforce template specialization requirements.
These utilities help ensure code clarity and maintainability across compilers and standard versions, and are typically used in template metaprogramming, constexpr logic, or when interfacing with platform-specific APIs.
Definition in file macros.hpp.
#define _IRSOL_STATIC_ASSERT_MISSING_TEMPLATE_SPECIALIZATION | ( | T, | |
messageLiteral | |||
) | IRSOL_STATIC_ASSERT((irsol::traits::always_false<T>::value), messageLiteral) |
Internal helper to trigger a static assertion when a required template specialization is missing.
This macro should not be used directly. Use IRSOL_MISSING_TEMPLATE_SPECIALIZATION instead.
T | The template type parameter for which specialization is missing. |
messageLiteral | A description of the missing specialization. |
Definition at line 148 of file macros.hpp.
#define _IRSOL_UNREACHABLE_IMPL | ( | ) |
Internal macro for compiler-specific unreachable code markers.
Expands to a compiler intrinsic that informs the optimizer the code is unreachable. Do not use directly—use IRSOL_UNREACHABLE instead.
Definition at line 84 of file macros.hpp.
#define IRSOL_MAYBE_UNUSED |
Suppresses compiler warnings about unused variables or parameters.
Use this macro to annotate variables or function parameters that are intentionally unused. It adapts to the best syntax supported by the current compiler and language standard.
Definition at line 39 of file macros.hpp.
#define IRSOL_MISSING_TEMPLATE_SPECIALIZATION | ( | T, | |
funcNameLiteral | |||
) |
Emits a compile-time error when no template specialization is available.
This macro is useful in if constexpr
chains to clearly indicate that a required template specialization has not been provided.
T | The template type parameter. |
funcNameLiteral | A string literal representing the function or context. |
Definition at line 173 of file macros.hpp.
#define IRSOL_STATIC_UNREACHABLE | ( | messageLiteral | ) |
Marks unreachable branches in constexpr
functions.
This macro emits a compile-time error when reached. It is designed for use in if constexpr
branches that should never be selected at compile-time.
constexpr
), it still falls back to IRSOL_UNREACHABLE to mark the code as unreachable at runtime.messageLiteral | A literal C-string message describing the unreachable condition. |
Definition at line 130 of file macros.hpp.
#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_END |
Ends a diagnostic suppression block started with IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START.
Definition at line 69 of file macros.hpp.
#define IRSOL_SUPPRESS_UNUSED_STRUCTURED_BINDING_START |
Begins a diagnostic suppression block for unused structured binding variables.
Useful when only part of a structured binding is used inside a loop or block.
Definition at line 68 of file macros.hpp.
#define IRSOL_UNREACHABLE | ( | ) | _IRSOL_UNREACHABLE_IMPL() |
Indicates unreachable code to the compiler.
Use this macro in logically unreachable branches (e.g., fully covered switch cases) to suppress warnings and help with optimization.
Definition at line 107 of file macros.hpp.