namespace sysio {
namespace vm { \
const char*
name() const noexcept
override {
return #
NAME; } \
std::string message(int ev) const override; \
}; \
const CATEGORY##_category __##CATEGORY##_category{}; \
template <typename T> \
-> std::enable_if_t<std::is_same_v<T, CATEGORY##_category>, bool> { \
return ec.category() == __##CATEGORY##_category; \
} \
} \
}
std::error_category error_category_t
23#define GENERATE_ERROR_CATEGORY(CATEGORY, NAME) \
24 namespace sysio { namespace vm { \
25 struct CATEGORY##_category : error_category_t { \
26 const char* name() const noexcept override { return #NAME; } \
27 std::string message(int ev) const override; \
28 }; \
29 const CATEGORY##_category __##CATEGORY##_category{}; \
30 template <typename T> \
31 static inline constexpr auto is_a(const error_code_t& ec) \
32 -> std::enable_if_t<std::is_same_v<T, CATEGORY##_category>, bool> { \
33 return ec.category() == __##CATEGORY##_category; \
34 } \
35 } \
36 }