| 470 | |
| 471 | template <typename R, typename FormatContext> |
| 472 | FMT_CONSTEXPR auto format(R&& range, FormatContext& ctx) const |
| 473 | -> decltype(ctx.out()) { |
| 474 | auto out = ctx.out(); |
| 475 | auto it = detail::range_begin(range); |
| 476 | auto end = detail::range_end(range); |
| 477 | if (is_debug) return write_debug_string(out, std::move(it), end); |
| 478 | |
| 479 | out = detail::copy<Char>(opening_bracket_, out); |
| 480 | int i = 0; |
| 481 | for (; it != end; ++it) { |
| 482 | if (i > 0) out = detail::copy<Char>(separator_, out); |
| 483 | ctx.advance_to(out); |
| 484 | auto&& item = *it; // Need an lvalue |
| 485 | out = underlying_.format(item, ctx); |
| 486 | ++i; |
| 487 | } |
| 488 | out = detail::copy<Char>(closing_bracket_, out); |
| 489 | return out; |
| 490 | } |
| 491 | }; |
| 492 | |
| 493 | FMT_EXPORT |
no test coverage detected