From 5aabf1f7152bb6135adead92bb7157c3aa61e4db Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 29 May 2020 17:59:08 -0700 Subject: [PATCH] Simplify copy_str --- include/fmt/format.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 7b73f8af..3bb2b0d1 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -549,8 +549,6 @@ inline size_t code_point_index(basic_string_view s, size_t n) { return s.size(); } -inline char8_type to_char8_t(char c) { return static_cast(c); } - template using needs_conversion = bool_constant< std::is_same::value_type, @@ -566,7 +564,8 @@ OutputIt copy_str(InputIt begin, InputIt end, OutputIt it) { template ::value)> OutputIt copy_str(InputIt begin, InputIt end, OutputIt it) { - return std::transform(begin, end, it, to_char8_t); + return std::transform(begin, end, it, + [](char c) { return static_cast(c); }); } #ifndef FMT_USE_GRISU