36 static auto normal_format(
const Aggregate& from, fmt::format_context& ctx) {
37 ctx.advance_to(fmt::format_to(ctx.out(),
"{}", boost::typeindex::type_id<Aggregate>().pretty_name()));
41 boost::pfr::for_each_field_with_name(from,
42 [&, first =
true](std::string_view field_name,
const auto& val)
mutable {
44 ctx.advance_to(fmt::format_to(ctx.out(),
", "));
47 ctx.advance_to(fmt::format_to(ctx.out(),
".{}={}", field_name, val));
54 static auto debug_format(
const Aggregate& from, fmt::format_context& ctx) {
55 static std::string indent;
58 fmt::format_to(ctx.out(),
"{}{} {{\n", indent, boost::typeindex::type_id<Aggregate>().pretty_name()));
62 boost::pfr::for_each_field_with_name(
63 from, [&, first =
true](std::string_view field_name,
const auto& val)
mutable {
65 ctx.advance_to(fmt::format_to(ctx.out(),
",\n"));
68 ctx.advance_to(fmt::format_to(ctx.out(),
"{}.{} = {}", indent, field_name, val));
73 ctx.advance_to(fmt::format_to(ctx.out(),
"\n{}}}", indent));