diff --git a/include/fmt/core.h b/include/fmt/core.h index 2f0cfb0b72c5..1fda229e274a 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -325,6 +325,8 @@ template using bool_constant = std::integral_constant; template using remove_reference_t = typename std::remove_reference::type; template +using remove_const_t = typename std::remove_const::type; +template using remove_cvref_t = typename std::remove_cv>::type; template struct type_identity { using type = T; }; template using type_identity_t = typename type_identity::type; @@ -746,13 +748,14 @@ FMT_CONSTEXPR auto copy_str(InputIt begin, InputIt end, OutputIt out) return out; } -template ::value)> -FMT_CONSTEXPR auto copy_str(const Char* begin, const Char* end, Char* out) - -> Char* { +template , U>::value && is_char::value)> +FMT_CONSTEXPR auto copy_str(T* begin, T* end, U* out) + -> U* { if (is_constant_evaluated()) - return copy_str(begin, end, out); + return copy_str(begin, end, out); auto size = to_unsigned(end - begin); - memcpy(out, begin, size); + memcpy(out, begin, size * sizeof(U)); return out + size; }