diff --git a/include/fmt/core.h b/include/fmt/core.h index 3d32e3ec..94c23e97 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -332,6 +332,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; @@ -755,13 +757,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; }