30#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
34template <
typename... Args>
43template <
typename... Args>
45 const Args&... args) {
50constexpr auto operator"" _format(
const wchar_t* s,
size_t n)
51 -> detail::udl_formatter<wchar_t> {
55#if FMT_USE_USER_DEFINED_LITERALS && !FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
56constexpr detail::udl_arg<wchar_t>
operator"" _a(
const wchar_t* s,
size_t) {
62template <
typename It,
typename Sentinel>
65 return {begin, end, sep};
68template <
typename Range>
81template <
typename Char, FMT_ENABLE_IF(!std::is_same<Char,
char>::value)>
86 detail::vformat_to(
buffer, format_str, args);
92template <
typename S,
typename... Args,
typename Char =
char_t<S>,
95 const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
96 return vformat(to_string_view(format_str), vargs);
99template <
typename Locale,
typename S,
typename Char =
char_t<S>,
100 FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
101 detail::is_exotic_
char<Char>::value)>
103 const Locale& loc,
const S& format_str,
106 return detail::vformat(loc, to_string_view(format_str), args);
109template <
typename Locale,
typename S,
typename... Args,
113inline auto format(
const Locale& loc,
const S& format_str, Args&&... args)
115 return detail::vformat(loc, to_string_view(format_str),
116 fmt::make_args_checked<Args...>(format_str, args...));
119template <
typename OutputIt,
typename S,
typename Char =
char_t<S>,
120 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
121 detail::is_exotic_
char<Char>::value)>
125 auto&& buf = detail::get_buffer<Char>(out);
126 detail::vformat_to(buf, to_string_view(format_str), args);
127 return detail::get_iterator(buf);
130template <
typename OutputIt,
typename S,
typename... Args,
132 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
134inline auto format_to(OutputIt out,
const S&
fmt, Args&&... args) -> OutputIt {
135 const auto& vargs = fmt::make_args_checked<Args...>(
fmt, args...);
139template <
typename S,
typename... Args,
typename Char,
size_t SIZE,
140 typename Allocator,
FMT_ENABLE_IF(detail::is_string<S>::value)>
142 const S& format_str, Args&&... args) ->
144 const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
145 detail::vformat_to(buf, to_string_view(format_str), vargs, {});
146 return detail::buffer_appender<Char>(buf);
149template <
typename Locale,
typename S,
typename OutputIt,
typename... Args,
151 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
155 OutputIt out,
const Locale& loc,
const S& format_str,
157 auto&& buf = detail::get_buffer<Char>(out);
158 vformat_to(buf, to_string_view(format_str), args, detail::locale_ref(loc));
159 return detail::get_iterator(buf);
163 typename OutputIt,
typename Locale,
typename S,
typename... Args,
165 bool enable = detail::is_output_iterator<OutputIt, Char>::value&&
167inline auto format_to(OutputIt out,
const Locale& loc,
const S& format_str,
170 const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
171 return vformat_to(out, loc, to_string_view(format_str), vargs);
174template <
typename OutputIt,
typename Char,
typename... Args,
175 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
181 detail::iterator_buffer<OutputIt, Char, detail::fixed_buffer_traits> buf(out,
183 detail::vformat_to(buf, format_str, args);
184 return {buf.out(), buf.count()};
187template <
typename OutputIt,
typename S,
typename... Args,
189 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
193 const auto& vargs = fmt::make_args_checked<Args...>(
fmt, args...);
197template <
typename S,
typename... Args,
typename Char =
char_t<S>,
200 detail::counting_buffer<Char> buf;
201 const auto& vargs = fmt::make_args_checked<Args...>(
fmt, args...);
202 detail::vformat_to(buf, to_string_view(
fmt), vargs);
218template <
typename...
T>
auto vformat_to(OutputIt out, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char > > > args) -> OutputIt
auto vformat(basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char > > > args) -> std::basic_string< Char >
auto format_to(OutputIt out, const S &fmt, Args &&... args) -> OutputIt
basic_string_view< wchar_t > wstring_view
constexpr format_arg_store< wformat_context, Args... > make_wformat_args(const Args &... args)
auto vformat_to_n(OutputIt out, size_t n, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char > > > args) -> format_to_n_result< OutputIt >
auto format_to_n(OutputIt out, size_t n, const S &fmt, const Args &... args) -> format_to_n_result< OutputIt >
auto format(const S &format_str, Args &&... args) -> std::basic_string< Char >
auto formatted_size(const S &fmt, Args &&... args) -> size_t
auto to_wstring(const T &value) -> std::wstring
auto join(It begin, Sentinel end, wstring_view sep) -> join_view< It, Sentinel, wchar_t >
void print(std::FILE *f, wformat_string< T... > fmt, T &&... args)
void vprint(std::FILE *f, wstring_view fmt, wformat_args args)
buffer_context< wchar_t > wformat_context
void push_back(const T &value)
auto data() FMT_NOEXCEPT -> T *
typename detail::char_t_impl< S >::type char_t
#define FMT_MODULE_EXPORT_BEGIN
#define FMT_BEGIN_NAMESPACE
#define FMT_ENABLE_IF(...)
typename type_identity< T >::type type_identity_t
#define FMT_END_NAMESPACE
#define FMT_MODULE_EXPORT_END
decltype(std::end(std::declval< T & >())) sentinel_t