Workaround a bug in gcc
This commit is contained in:
parent
a29a01d304
commit
fbf3b943cc
@ -1360,6 +1360,10 @@ using buffer_context =
|
|||||||
using format_context = buffer_context<char>;
|
using format_context = buffer_context<char>;
|
||||||
using wformat_context = buffer_context<wchar_t>;
|
using wformat_context = buffer_context<wchar_t>;
|
||||||
|
|
||||||
|
// Workaround a bug in gcc: https://stackoverflow.com/q/62767544/471164.
|
||||||
|
#define FMT_BUFFER_CONTEXT(Char) \
|
||||||
|
basic_format_context<std::back_insert_iterator<detail::buffer<Char>>, Char>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
An array of references to arguments. It can be implicitly converted into
|
An array of references to arguments. It can be implicitly converted into
|
||||||
@ -1768,9 +1772,9 @@ std::basic_string<Char> vformat(
|
|||||||
std::string vformat(string_view format_str, format_args args);
|
std::string vformat(string_view format_str, format_args args);
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
typename buffer_context<Char>::iterator vformat_to(
|
typename FMT_BUFFER_CONTEXT(Char)::iterator vformat_to(
|
||||||
buffer<Char>& buf, basic_string_view<Char> format_str,
|
buffer<Char>& buf, basic_string_view<Char> format_str,
|
||||||
basic_format_args<buffer_context<type_identity_t<Char>>> args);
|
basic_format_args<FMT_BUFFER_CONTEXT(type_identity_t<Char>)> args);
|
||||||
|
|
||||||
template <typename Char, typename Args,
|
template <typename Char, typename Args,
|
||||||
FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
|
FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
|
||||||
|
@ -3482,9 +3482,9 @@ extern template int snprintf_float<long double>(long double value,
|
|||||||
|
|
||||||
template <typename S, typename Char = char_t<S>,
|
template <typename S, typename Char = char_t<S>,
|
||||||
FMT_ENABLE_IF(detail::is_string<S>::value)>
|
FMT_ENABLE_IF(detail::is_string<S>::value)>
|
||||||
inline typename buffer_context<Char>::iterator vformat_to(
|
inline typename FMT_BUFFER_CONTEXT(Char)::iterator vformat_to(
|
||||||
detail::buffer<Char>& buf, const S& format_str,
|
detail::buffer<Char>& buf, const S& format_str,
|
||||||
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
|
basic_format_args<FMT_BUFFER_CONTEXT(type_identity_t<Char>)> args) {
|
||||||
return detail::vformat_to(buf, to_string_view(format_str), args);
|
return detail::vformat_to(buf, to_string_view(format_str), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,9 @@ 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 void detail::buffer<char>::append(const char*, const char*);
|
||||||
|
|
||||||
template FMT_API format_context::iterator detail::vformat_to(
|
template FMT_API FMT_BUFFER_CONTEXT(char)::iterator detail::vformat_to(
|
||||||
detail::buffer<char>&, string_view, basic_format_args<format_context>);
|
detail::buffer<char>&, string_view,
|
||||||
|
basic_format_args<FMT_BUFFER_CONTEXT(char)>);
|
||||||
|
|
||||||
template FMT_API int detail::snprintf_float(double, int, detail::float_specs,
|
template FMT_API int detail::snprintf_float(double, int, detail::float_specs,
|
||||||
detail::buffer<char>&);
|
detail::buffer<char>&);
|
||||||
|
Loading…
Reference in New Issue
Block a user