Skip to content

Commit

Permalink
Review: revert moved format()
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans-Martin B. Jensen committed Apr 17, 2024
1 parent 3bbf923 commit 468f042
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions include/fmt/xchar.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ auto join(const std::tuple<T...>& tuple, basic_string_view<wchar_t> sep)
return {tuple, sep};
}

template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
auto vformat(basic_string_view<Char> format_str,
typename detail::vformat_args<Char>::type args)
-> std::basic_string<Char> {
auto buf = basic_memory_buffer<Char>();
detail::vformat_to(buf, format_str, args);
return to_string(buf);
}

template <typename... T>
auto format(wformat_string<T...> fmt, T&&... args) -> std::wstring {
return vformat(fmt::wstring_view(fmt), fmt::make_wformat_args(args...));
Expand All @@ -139,15 +148,6 @@ auto format_to(OutputIt out, wformat_string<T...> fmt, T&&... args)
fmt::make_wformat_args(args...));
}

template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
auto vformat(basic_string_view<Char> format_str,
typename detail::vformat_args<Char>::type args)
-> std::basic_string<Char> {
auto buf = basic_memory_buffer<Char>();
detail::vformat_to(buf, format_str, args);
return to_string(buf);
}

// Pass char_t as a default template parameter instead of using
// std::basic_string<char_t<S>> to reduce the symbol size.
template <typename S, typename... T,
Expand Down

0 comments on commit 468f042

Please sign in to comment.