Make symbols readable

This commit is contained in:
Victor Zverovich 2020-06-07 07:49:11 -07:00
parent 57ddc77ce7
commit 6732ea5000
4 changed files with 10 additions and 5 deletions

View File

@ -1762,11 +1762,13 @@ make_args_checked(const S& format_str,
return {args...};
}
template <typename Char>
template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
std::basic_string<Char> vformat(
basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args);
std::string vformat(string_view format_str, format_args args);
template <typename Char>
typename buffer_context<Char>::iterator vformat_to(
buffer<Char>& buf, basic_string_view<Char> format_str,

View File

@ -1365,6 +1365,12 @@ FMT_FUNC void report_system_error(int error_code,
report_error(format_system_error, error_code, message);
}
FMT_FUNC std::string detail::vformat(string_view format_str, format_args args) {
memory_buffer buffer;
detail::vformat_to(buffer, format_str, args);
return to_string(buffer);
}
FMT_FUNC void vprint(std::FILE* f, string_view format_str, format_args args) {
memory_buffer buffer;
detail::vformat_to(buffer, format_str,

View File

@ -3440,7 +3440,7 @@ inline format_to_n_result<OutputIt> format_to_n(OutputIt out, size_t n,
make_format_args<context>(args...));
}
template <typename Char>
template <typename Char, enable_if_t<(!std::is_same<Char, char>::value), int>>
std::basic_string<Char> detail::vformat(
basic_string_view<Char> format_str,
basic_format_args<buffer_context<type_identity_t<Char>>> args) {

View File

@ -44,9 +44,6 @@ template FMT_API char detail::decimal_point_impl(locale_ref);
template FMT_API void detail::buffer<char>::append(const char*, const char*);
template FMT_API std::string detail::vformat<char>(
string_view, basic_format_args<format_context>);
template FMT_API format_context::iterator detail::vformat_to(
detail::buffer<char>&, string_view, basic_format_args<format_context>);