| 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 | |
| 2277 | enum { packed_arg_bits = 4 }; |
no test coverage detected