Euphoria
pch.public.h
Go to the documentation of this file.
1// public header file for the precompiled header
2
3#include <fmt/core.h>
4#include <fmt/format.h>
5#include <fmt/ranges.h>
6
7// todo(Gustav): remove this when all formatters are fully ported
8// #include <fmt/ostream.h>
9// using namespace fmt::literals;
10
11
12#define ADD_DEFAULT_FORMATTER(TYPE, STRING, TO_STRING) \
13template <> struct fmt::formatter<TYPE>: fmt::formatter<STRING> \
14{ \
15 template <typename FormatContext> \
16 auto format(const TYPE& c, FormatContext& ctx) const \
17 { \
18 return fmt::formatter<STRING>::format(TO_STRING(c), ctx); \
19 } \
20}
21
22#define ADD_CATCH_FORMATTER_DEF(TYPE) \
23std::ostream& \
24operator<<(std::ostream& stream, const TYPE& v);
25
26#define ADD_CATCH_FORMATTER_IMPL(TYPE) \
27std::ostream& \
28operator<<(std::ostream& stream, const TYPE& v) \
29{ \
30 return stream << ::eu::string_from(v); \
31}