| 3084 | |
| 3085 | template <typename T, typename FormatContext> |
| 3086 | auto format(const T& val, FormatContext& ctx) -> decltype(ctx.out()) { |
| 3087 | handle_specs(ctx); |
| 3088 | internal::specs_checker<null_handler> checker( |
| 3089 | null_handler(), |
| 3090 | internal::mapped_type_constant<T, FormatContext>::value); |
| 3091 | checker.on_align(specs_.align); |
| 3092 | switch (specs_.sign) { |
| 3093 | case sign::none: |
| 3094 | break; |
| 3095 | case sign::plus: |
| 3096 | checker.on_plus(); |
| 3097 | break; |
| 3098 | case sign::minus: |
| 3099 | checker.on_minus(); |
| 3100 | break; |
| 3101 | case sign::space: |
| 3102 | checker.on_space(); |
| 3103 | break; |
| 3104 | } |
| 3105 | if (specs_.alt) checker.on_hash(); |
| 3106 | if (specs_.precision >= 0) checker.end_precision(); |
| 3107 | using range = internal::output_range<typename FormatContext::iterator, |
| 3108 | typename FormatContext::char_type>; |
| 3109 | visit_format_arg(arg_formatter<range>(ctx, nullptr, &specs_), |
| 3110 | internal::make_arg<FormatContext>(val)); |
| 3111 | return ctx.out(); |
| 3112 | } |
| 3113 | |
| 3114 | private: |
| 3115 | template <typename Context> void handle_specs(Context& ctx) { |
nothing calls this directly
no test coverage detected