MCPcopy Create free account
hub / github.com/fmtlib/fmt / format_custom

Method format_custom

include/fmt/base.h:2265–2274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2263 // Formats an argument of a custom type, such as a user-defined class.
2264 template <typename T>
2265 static void format_custom(void* arg, parse_context<char_type>& parse_ctx,
2266 Context& ctx) {
2267 auto f = formatter<T, char_type>();
2268 parse_ctx.advance_to(f.parse(parse_ctx));
2269 using qualified_type =
2270 conditional_t<has_formatter<const T, char_type>(), const T, T>;
2271 // format must be const for compatibility with std::format and compilation.
2272 const auto& cf = f;
2273 ctx.advance_to(cf.format(*static_cast<qualified_type*>(arg), ctx));
2274 }
2275};
2276
2277enum { packed_arg_bits = 4 };

Callers 1

on_format_specsMethod · 0.45

Calls 3

advance_toMethod · 0.45
parseMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected