Fix core version of vformat_to

This commit is contained in:
Victor Zverovich
2018-10-24 18:42:42 -07:00
parent ea4010d704
commit 61e6d2e38c
4 changed files with 31 additions and 12 deletions
+7 -8
View File
@@ -16,7 +16,7 @@
#include <type_traits>
// The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 50201
#define FMT_VERSION 50202
#ifdef __has_feature
# define FMT_HAS_FEATURE(x) __has_feature(x)
@@ -1350,6 +1350,11 @@ template <typename Char>
std::basic_string<Char> vformat(
basic_string_view<Char> format_str,
basic_format_args<typename buffer_context<Char>::type> args);
template <typename Char>
typename buffer_context<Char>::type::iterator vformat_to(
internal::basic_buffer<Char> &buf, basic_string_view<Char> format_str,
basic_format_args<typename buffer_context<Char>::type> args);
}
/**
@@ -1371,16 +1376,10 @@ inline internal::named_arg<T, wchar_t> arg(wstring_view name, const T &arg) {
return {name, arg};
}
// This function template is deleted intentionally to disable nested named
// arguments as in ``format("{}", arg("a", arg("b", 42)))``.
// Disable nested named arguments, e.g. ``arg("a", arg("b", 42))``.
template <typename S, typename T, typename Char>
void arg(S, internal::named_arg<T, Char>) = delete;
template <typename S>
typename buffer_context<FMT_CHAR(S)>::type::iterator vformat_to(
internal::basic_buffer<FMT_CHAR(S)> &buf, const S &format_str,
basic_format_args<buffer_context<FMT_CHAR(S)> > args);
template <typename Container>
struct is_contiguous: std::false_type {};
+11 -4
View File
@@ -3365,15 +3365,22 @@ std::basic_string<Char> to_string(const basic_memory_buffer<Char, SIZE> &buf) {
return std::basic_string<Char>(buf.data(), buf.size());
}
template <typename String, typename Char = FMT_CHAR(String)>
inline typename buffer_context<FMT_CHAR(String)>::type::iterator vformat_to(
internal::basic_buffer<Char> &buf, const String &format_str,
template <typename Char>
typename buffer_context<Char>::type::iterator internal::vformat_to(
internal::basic_buffer<Char> &buf, basic_string_view<Char> format_str,
basic_format_args<typename buffer_context<Char>::type> args) {
typedef back_insert_range<internal::basic_buffer<FMT_CHAR(String)> > range;
typedef back_insert_range<internal::basic_buffer<Char> > range;
return vformat_to<arg_formatter<range>>(
buf, to_string_view(format_str), args);
}
template <typename S, typename Char = FMT_CHAR(S)>
inline typename buffer_context<Char>::type::iterator vformat_to(
internal::basic_buffer<Char> &buf, const S &format_str,
basic_format_args<typename buffer_context<Char>::type> args) {
return vformat_to(buf, to_string_view(format_str), args);
}
template <
typename S, typename... Args,
std::size_t SIZE = inline_buffer_size,