Loading...
Searching...
No Matches
Go to the documentation of this file.
8#include <boost/preprocessor/punctuation/comma_if.hpp>
9#include <boost/preprocessor/seq/for_each_i.hpp>
10#include <boost/preprocessor/stringize.hpp>
11#include <boost/preprocessor/tuple/size.hpp>
12#include <boost/preprocessor/tuple/to_seq.hpp>
14#include <fmt/format.h>
15#include <fmt/ranges.h>
16#include <range/v3/algorithm/copy.hpp>
17#include <range/v3/view/transform.hpp>
19#define FMT_SERIALIZE_CLASS_MEMBER_IMPL(r, class_name, i, ident) \
20 BOOST_PP_COMMA_IF(i)::asmgrader::pair { \
21 ::asmgrader::StaticString{BOOST_PP_STRINGIZE(ident)}, &class_name::ident \
24#define FMT_SERIALIZE_CLASS(class_name, ... ) \
26 struct fmt::formatter<class_name> \
27 : ::asmgrader::detail::AggregateFormatter< \
29 #class_name __VA_OPT__(, BOOST_PP_SEQ_FOR_EACH_I( \
30 FMT_SERIALIZE_CLASS_MEMBER_IMPL, class_name, \
31 BOOST_PP_TUPLE_TO_SEQ(BOOST_PP_TUPLE_SIZE((__VA_ARGS__)), (__VA_ARGS__))))> \
35#define FMT_SERIALIZE_ENUMERATOR_IMPL(r, enum_name, i, ident) \
36 BOOST_PP_COMMA_IF(i)::asmgrader::pair { \
37 ::asmgrader::StaticString{BOOST_PP_STRINGIZE(ident)}, enum_name::ident \
40#define FMT_SERIALIZE_ENUM(enum_name, ... ) \
42 struct fmt::formatter<enum_name> \
43 : ::asmgrader::detail::EnumFormatter< \
45 #enum_name __VA_OPT__(, BOOST_PP_SEQ_FOR_EACH_I( \
46 FMT_SERIALIZE_ENUMERATOR_IMPL, enum_name, \
47 BOOST_PP_TUPLE_TO_SEQ(BOOST_PP_TUPLE_SIZE((__VA_ARGS__)), (__VA_ARGS__))))> \