#include <type_traits>
#include <variant>
Go to the source code of this file.
◆ MAYBE_VOID
| #define MAYBE_VOID |
( |
|
name, |
|
|
|
expr |
|
) |
| |
Value: [[maybe_unused]] typename TypeOrMonostate<decltype(expr)>::type name; \
MAYBE_VOID_ASSIGN(name, expr)
Expand to auto name = expr for normal types, and expand to expr for void
◆ MAYBE_VOID_ASSIGN
| #define MAYBE_VOID_ASSIGN |
( |
|
name, |
|
|
|
expr |
|
) |
| |
Value: if constexpr (std::is_same_v<decltype(expr), void>) { \
expr; \
} else { \
name = expr; \
}
Expand to name = expr for normal types, and expand to expr for void