diff --git a/include/fmt/printf.h b/include/fmt/printf.h index b44afaba..b95b56cf 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -480,11 +480,13 @@ OutputIt basic_printf_context::format() { } char_type c = *it++; if (it != end && *it == c) { - out = std::copy(start, it, out); + out = detail::write( + out, basic_string_view(start, detail::to_unsigned(it - start))); start = ++it; continue; } - out = std::copy(start, it - 1, out); + out = detail::write(out, basic_string_view( + start, detail::to_unsigned(it - 1 - start))); format_specs specs; specs.align = align::right; @@ -596,7 +598,8 @@ OutputIt basic_printf_context::format() { // Format argument. out = visit_format_arg(ArgFormatter(out, specs, *this), arg); } - return std::copy(start, it, out); + return detail::write( + out, basic_string_view(start, detail::to_unsigned(it - start))); } template