Go to the documentation of this file.
11#define ADD_DEFAULT_FORMATTER(TYPE, STRING, TO_STRING) \
12template <> struct fmt::formatter<TYPE>: fmt::formatter<STRING> \
14 template <typename FormatContext> \
15 auto format(const TYPE& c, FormatContext& ctx) const \
17 return fmt::formatter<STRING>::format(TO_STRING(c), ctx); \
23#define EU_FMT_ENUM_BEGIN(T, DEF) \
24template <> struct fmt::formatter<T> : fmt::formatter<std::string_view> {\
25 template <typename FormatContext>\
26 auto format(T c, FormatContext& ctx) const {\
28 std::string_view name = DEF;\
30#define EU_FMT_ENUM_VAL(V)\
31 case EnumType::V: name = #V; break
32#define EU_FMT_ENUM_END()\
34 return formatter<string_view>::format(name, ctx);\
42#define ADD_CATCH_FORMATTER_DEF(TYPE) \
44operator<<(std::ostream& stream, const TYPE& v);
46#define ADD_CATCH_FORMATTER_IMPL(TYPE) \
48operator<<(std::ostream& stream, const TYPE& v) \
50 return stream << ::eu::string_from(v); \