Add MATCH macro

This commit is contained in:
Nekotekina 2018-08-24 00:31:48 +03:00
parent 6cc7d1fb26
commit 76bac80dde

View File

@ -45,6 +45,9 @@
// Return 32 bit alignof() to avoid widening/narrowing conversions with size_t
#define ALIGN_32(...) static_cast<u32>(alignof(__VA_ARGS__))
// Variant pattern matching helper
#define MATCH(arg, ...) constexpr(std::is_same_v<std::decay_t<decltype(arg)>, __VA_ARGS__>)
#define CONCATENATE_DETAIL(x, y) x ## y
#define CONCATENATE(x, y) CONCATENATE_DETAIL(x, y)