git repos / blockattack-game

blame: source/misc/embedded_libs/fmt-8.1.1/include/fmt/xchar.h

normal view · raw

f8deb5b9 Poul Sander 2022-01-15 13:55 1
// Formatting library for C++ - optional wchar_t and exotic character support
f8deb5b9 Poul Sander 2022-01-15 13:55 2
//
f8deb5b9 Poul Sander 2022-01-15 13:55 3
// Copyright (c) 2012 - present, Victor Zverovich
f8deb5b9 Poul Sander 2022-01-15 13:55 4
// All rights reserved.
f8deb5b9 Poul Sander 2022-01-15 13:55 5
//
f8deb5b9 Poul Sander 2022-01-15 13:55 6
// For the license information refer to format.h.
f8deb5b9 Poul Sander 2022-01-15 13:55 7
f8deb5b9 Poul Sander 2022-01-15 13:55 8
#ifndef FMT_XCHAR_H_
f8deb5b9 Poul Sander 2022-01-15 13:55 9
#define FMT_XCHAR_H_
f8deb5b9 Poul Sander 2022-01-15 13:55 10
f8deb5b9 Poul Sander 2022-01-15 13:55 11
#include <cwchar>
f8deb5b9 Poul Sander 2022-01-15 13:55 12
#include <tuple>
f8deb5b9 Poul Sander 2022-01-15 13:55 13
f8deb5b9 Poul Sander 2022-01-15 13:55 14
#include "format.h"
f8deb5b9 Poul Sander 2022-01-15 13:55 15
f8deb5b9 Poul Sander 2022-01-15 13:55 16
FMT_BEGIN_NAMESPACE
f8deb5b9 Poul Sander 2022-01-15 13:55 17
namespace detail {
f8deb5b9 Poul Sander 2022-01-15 13:55 18
template <typename T>
f8deb5b9 Poul Sander 2022-01-15 13:55 19
using is_exotic_char = bool_constant<!std::is_same<T, char>::value>;
f8deb5b9 Poul Sander 2022-01-15 13:55 20
}
f8deb5b9 Poul Sander 2022-01-15 13:55 21
f8deb5b9 Poul Sander 2022-01-15 13:55 22
FMT_MODULE_EXPORT_BEGIN
f8deb5b9 Poul Sander 2022-01-15 13:55 23
f8deb5b9 Poul Sander 2022-01-15 13:55 24
using wstring_view = basic_string_view<wchar_t>;
f8deb5b9 Poul Sander 2022-01-15 13:55 25
using wformat_parse_context = basic_format_parse_context<wchar_t>;
f8deb5b9 Poul Sander 2022-01-15 13:55 26
using wformat_context = buffer_context<wchar_t>;
f8deb5b9 Poul Sander 2022-01-15 13:55 27
using wformat_args = basic_format_args<wformat_context>;
f8deb5b9 Poul Sander 2022-01-15 13:55 28
using wmemory_buffer = basic_memory_buffer<wchar_t>;
f8deb5b9 Poul Sander 2022-01-15 13:55 29
f8deb5b9 Poul Sander 2022-01-15 13:55 30
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
f8deb5b9 Poul Sander 2022-01-15 13:55 31
// Workaround broken conversion on older gcc.
f8deb5b9 Poul Sander 2022-01-15 13:55 32
template <typename... Args> using wformat_string = wstring_view;
f8deb5b9 Poul Sander 2022-01-15 13:55 33
#else
f8deb5b9 Poul Sander 2022-01-15 13:55 34
template <typename... Args>
f8deb5b9 Poul Sander 2022-01-15 13:55 35
using wformat_string = basic_format_string<wchar_t, type_identity_t<Args>...>;
f8deb5b9 Poul Sander 2022-01-15 13:55 36
#endif
f8deb5b9 Poul Sander 2022-01-15 13:55 37
f8deb5b9 Poul Sander 2022-01-15 13:55 38
template <> struct is_char<wchar_t> : std::true_type {};
f8deb5b9 Poul Sander 2022-01-15 13:55 39
template <> struct is_char<detail::char8_type> : std::true_type {};
f8deb5b9 Poul Sander 2022-01-15 13:55 40
template <> struct is_char<char16_t> : std::true_type {};
f8deb5b9 Poul Sander 2022-01-15 13:55 41
template <> struct is_char<char32_t> : std::true_type {};
f8deb5b9 Poul Sander 2022-01-15 13:55 42
f8deb5b9 Poul Sander 2022-01-15 13:55 43
template <typename... Args>
f8deb5b9 Poul Sander 2022-01-15 13:55 44
constexpr format_arg_store<wformat_context, Args...> make_wformat_args(
f8deb5b9 Poul Sander 2022-01-15 13:55 45
    const Args&... args) {
f8deb5b9 Poul Sander 2022-01-15 13:55 46
  return {args...};
f8deb5b9 Poul Sander 2022-01-15 13:55 47
}
f8deb5b9 Poul Sander 2022-01-15 13:55 48
f8deb5b9 Poul Sander 2022-01-15 13:55 49
inline namespace literals {
f8deb5b9 Poul Sander 2022-01-15 13:55 50
constexpr auto operator"" _format(const wchar_t* s, size_t n)
f8deb5b9 Poul Sander 2022-01-15 13:55 51
    -> detail::udl_formatter<wchar_t> {
f8deb5b9 Poul Sander 2022-01-15 13:55 52
  return {{s, n}};
f8deb5b9 Poul Sander 2022-01-15 13:55 53
}
f8deb5b9 Poul Sander 2022-01-15 13:55 54
f8deb5b9 Poul Sander 2022-01-15 13:55 55
#if FMT_USE_USER_DEFINED_LITERALS && !FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
f8deb5b9 Poul Sander 2022-01-15 13:55 56
constexpr detail::udl_arg<wchar_t> operator"" _a(const wchar_t* s, size_t) {
f8deb5b9 Poul Sander 2022-01-15 13:55 57
  return {s};
f8deb5b9 Poul Sander 2022-01-15 13:55 58
}
f8deb5b9 Poul Sander 2022-01-15 13:55 59
#endif
f8deb5b9 Poul Sander 2022-01-15 13:55 60
}  // namespace literals
f8deb5b9 Poul Sander 2022-01-15 13:55 61
f8deb5b9 Poul Sander 2022-01-15 13:55 62
template <typename It, typename Sentinel>
f8deb5b9 Poul Sander 2022-01-15 13:55 63
auto join(It begin, Sentinel end, wstring_view sep)
f8deb5b9 Poul Sander 2022-01-15 13:55 64
    -> join_view<It, Sentinel, wchar_t> {
f8deb5b9 Poul Sander 2022-01-15 13:55 65
  return {begin, end, sep};
f8deb5b9 Poul Sander 2022-01-15 13:55 66
}
f8deb5b9 Poul Sander 2022-01-15 13:55 67
f8deb5b9 Poul Sander 2022-01-15 13:55 68
template <typename Range>
f8deb5b9 Poul Sander 2022-01-15 13:55 69
auto join(Range&& range, wstring_view sep)
f8deb5b9 Poul Sander 2022-01-15 13:55 70
    -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>,
f8deb5b9 Poul Sander 2022-01-15 13:55 71
                 wchar_t> {
f8deb5b9 Poul Sander 2022-01-15 13:55 72
  return join(std::begin(range), std::end(range), sep);
f8deb5b9 Poul Sander 2022-01-15 13:55 73
}
f8deb5b9 Poul Sander 2022-01-15 13:55 74
f8deb5b9 Poul Sander 2022-01-15 13:55 75
template <typename T>
f8deb5b9 Poul Sander 2022-01-15 13:55 76
auto join(std::initializer_list<T> list, wstring_view sep)
f8deb5b9 Poul Sander 2022-01-15 13:55 77
    -> join_view<const T*, const T*, wchar_t> {
f8deb5b9 Poul Sander 2022-01-15 13:55 78
  return join(std::begin(list), std::end(list), sep);
f8deb5b9 Poul Sander 2022-01-15 13:55 79
}
f8deb5b9 Poul Sander 2022-01-15 13:55 80
f8deb5b9 Poul Sander 2022-01-15 13:55 81
template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 82
auto vformat(basic_string_view<Char> format_str,
f8deb5b9 Poul Sander 2022-01-15 13:55 83
             basic_format_args<buffer_context<type_identity_t<Char>>> args)
f8deb5b9 Poul Sander 2022-01-15 13:55 84
    -> std::basic_string<Char> {
f8deb5b9 Poul Sander 2022-01-15 13:55 85
  basic_memory_buffer<Char> buffer;
f8deb5b9 Poul Sander 2022-01-15 13:55 86
  detail::vformat_to(buffer, format_str, args);
f8deb5b9 Poul Sander 2022-01-15 13:55 87
  return to_string(buffer);
f8deb5b9 Poul Sander 2022-01-15 13:55 88
}
f8deb5b9 Poul Sander 2022-01-15 13:55 89
f8deb5b9 Poul Sander 2022-01-15 13:55 90
// Pass char_t as a default template parameter instead of using
f8deb5b9 Poul Sander 2022-01-15 13:55 91
// std::basic_string<char_t<S>> to reduce the symbol size.
f8deb5b9 Poul Sander 2022-01-15 13:55 92
template <typename S, typename... Args, typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 93
          FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 94
auto format(const S& format_str, Args&&... args) -> std::basic_string<Char> {
f8deb5b9 Poul Sander 2022-01-15 13:55 95
  const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
f8deb5b9 Poul Sander 2022-01-15 13:55 96
  return vformat(to_string_view(format_str), vargs);
f8deb5b9 Poul Sander 2022-01-15 13:55 97
}
f8deb5b9 Poul Sander 2022-01-15 13:55 98
f8deb5b9 Poul Sander 2022-01-15 13:55 99
template <typename Locale, typename S, typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 100
          FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 101
                            detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 102
inline auto vformat(
f8deb5b9 Poul Sander 2022-01-15 13:55 103
    const Locale& loc, const S& format_str,
f8deb5b9 Poul Sander 2022-01-15 13:55 104
    basic_format_args<buffer_context<type_identity_t<Char>>> args)
f8deb5b9 Poul Sander 2022-01-15 13:55 105
    -> std::basic_string<Char> {
f8deb5b9 Poul Sander 2022-01-15 13:55 106
  return detail::vformat(loc, to_string_view(format_str), args);
f8deb5b9 Poul Sander 2022-01-15 13:55 107
}
f8deb5b9 Poul Sander 2022-01-15 13:55 108
f8deb5b9 Poul Sander 2022-01-15 13:55 109
template <typename Locale, typename S, typename... Args,
f8deb5b9 Poul Sander 2022-01-15 13:55 110
          typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 111
          FMT_ENABLE_IF(detail::is_locale<Locale>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 112
                            detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 113
inline auto format(const Locale& loc, const S& format_str, Args&&... args)
f8deb5b9 Poul Sander 2022-01-15 13:55 114
    -> std::basic_string<Char> {
f8deb5b9 Poul Sander 2022-01-15 13:55 115
  return detail::vformat(loc, to_string_view(format_str),
f8deb5b9 Poul Sander 2022-01-15 13:55 116
                         fmt::make_args_checked<Args...>(format_str, args...));
f8deb5b9 Poul Sander 2022-01-15 13:55 117
}
f8deb5b9 Poul Sander 2022-01-15 13:55 118
f8deb5b9 Poul Sander 2022-01-15 13:55 119
template <typename OutputIt, typename S, typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 120
          FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 121
                            detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 122
auto vformat_to(OutputIt out, const S& format_str,
f8deb5b9 Poul Sander 2022-01-15 13:55 123
                basic_format_args<buffer_context<type_identity_t<Char>>> args)
f8deb5b9 Poul Sander 2022-01-15 13:55 124
    -> OutputIt {
f8deb5b9 Poul Sander 2022-01-15 13:55 125
  auto&& buf = detail::get_buffer<Char>(out);
f8deb5b9 Poul Sander 2022-01-15 13:55 126
  detail::vformat_to(buf, to_string_view(format_str), args);
f8deb5b9 Poul Sander 2022-01-15 13:55 127
  return detail::get_iterator(buf);
f8deb5b9 Poul Sander 2022-01-15 13:55 128
}
f8deb5b9 Poul Sander 2022-01-15 13:55 129
f8deb5b9 Poul Sander 2022-01-15 13:55 130
template <typename OutputIt, typename S, typename... Args,
f8deb5b9 Poul Sander 2022-01-15 13:55 131
          typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 132
          FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 133
                            detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 134
inline auto format_to(OutputIt out, const S& fmt, Args&&... args) -> OutputIt {
f8deb5b9 Poul Sander 2022-01-15 13:55 135
  const auto& vargs = fmt::make_args_checked<Args...>(fmt, args...);
f8deb5b9 Poul Sander 2022-01-15 13:55 136
  return vformat_to(out, to_string_view(fmt), vargs);
f8deb5b9 Poul Sander 2022-01-15 13:55 137
}
f8deb5b9 Poul Sander 2022-01-15 13:55 138
f8deb5b9 Poul Sander 2022-01-15 13:55 139
template <typename S, typename... Args, typename Char, size_t SIZE,
f8deb5b9 Poul Sander 2022-01-15 13:55 140
          typename Allocator, FMT_ENABLE_IF(detail::is_string<S>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 141
FMT_DEPRECATED auto format_to(basic_memory_buffer<Char, SIZE, Allocator>& buf,
f8deb5b9 Poul Sander 2022-01-15 13:55 142
                              const S& format_str, Args&&... args) ->
f8deb5b9 Poul Sander 2022-01-15 13:55 143
    typename buffer_context<Char>::iterator {
f8deb5b9 Poul Sander 2022-01-15 13:55 144
  const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
f8deb5b9 Poul Sander 2022-01-15 13:55 145
  detail::vformat_to(buf, to_string_view(format_str), vargs, {});
f8deb5b9 Poul Sander 2022-01-15 13:55 146
  return detail::buffer_appender<Char>(buf);
f8deb5b9 Poul Sander 2022-01-15 13:55 147
}
f8deb5b9 Poul Sander 2022-01-15 13:55 148
f8deb5b9 Poul Sander 2022-01-15 13:55 149
template <typename Locale, typename S, typename OutputIt, typename... Args,
f8deb5b9 Poul Sander 2022-01-15 13:55 150
          typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 151
          FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 152
                            detail::is_locale<Locale>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 153
                                detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 154
inline auto vformat_to(
f8deb5b9 Poul Sander 2022-01-15 13:55 155
    OutputIt out, const Locale& loc, const S& format_str,
f8deb5b9 Poul Sander 2022-01-15 13:55 156
    basic_format_args<buffer_context<type_identity_t<Char>>> args) -> OutputIt {
f8deb5b9 Poul Sander 2022-01-15 13:55 157
  auto&& buf = detail::get_buffer<Char>(out);
f8deb5b9 Poul Sander 2022-01-15 13:55 158
  vformat_to(buf, to_string_view(format_str), args, detail::locale_ref(loc));
f8deb5b9 Poul Sander 2022-01-15 13:55 159
  return detail::get_iterator(buf);
f8deb5b9 Poul Sander 2022-01-15 13:55 160
}
f8deb5b9 Poul Sander 2022-01-15 13:55 161
f8deb5b9 Poul Sander 2022-01-15 13:55 162
template <
f8deb5b9 Poul Sander 2022-01-15 13:55 163
    typename OutputIt, typename Locale, typename S, typename... Args,
f8deb5b9 Poul Sander 2022-01-15 13:55 164
    typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 165
    bool enable = detail::is_output_iterator<OutputIt, Char>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 166
        detail::is_locale<Locale>::value&& detail::is_exotic_char<Char>::value>
f8deb5b9 Poul Sander 2022-01-15 13:55 167
inline auto format_to(OutputIt out, const Locale& loc, const S& format_str,
f8deb5b9 Poul Sander 2022-01-15 13:55 168
                      Args&&... args) ->
f8deb5b9 Poul Sander 2022-01-15 13:55 169
    typename std::enable_if<enable, OutputIt>::type {
f8deb5b9 Poul Sander 2022-01-15 13:55 170
  const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
f8deb5b9 Poul Sander 2022-01-15 13:55 171
  return vformat_to(out, loc, to_string_view(format_str), vargs);
f8deb5b9 Poul Sander 2022-01-15 13:55 172
}
f8deb5b9 Poul Sander 2022-01-15 13:55 173
f8deb5b9 Poul Sander 2022-01-15 13:55 174
template <typename OutputIt, typename Char, typename... Args,
f8deb5b9 Poul Sander 2022-01-15 13:55 175
          FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 176
                            detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 177
inline auto vformat_to_n(
f8deb5b9 Poul Sander 2022-01-15 13:55 178
    OutputIt out, size_t n, basic_string_view<Char> format_str,
f8deb5b9 Poul Sander 2022-01-15 13:55 179
    basic_format_args<buffer_context<type_identity_t<Char>>> args)
f8deb5b9 Poul Sander 2022-01-15 13:55 180
    -> format_to_n_result<OutputIt> {
f8deb5b9 Poul Sander 2022-01-15 13:55 181
  detail::iterator_buffer<OutputIt, Char, detail::fixed_buffer_traits> buf(out,
f8deb5b9 Poul Sander 2022-01-15 13:55 182
                                                                           n);
f8deb5b9 Poul Sander 2022-01-15 13:55 183
  detail::vformat_to(buf, format_str, args);
f8deb5b9 Poul Sander 2022-01-15 13:55 184
  return {buf.out(), buf.count()};
f8deb5b9 Poul Sander 2022-01-15 13:55 185
}
f8deb5b9 Poul Sander 2022-01-15 13:55 186
f8deb5b9 Poul Sander 2022-01-15 13:55 187
template <typename OutputIt, typename S, typename... Args,
f8deb5b9 Poul Sander 2022-01-15 13:55 188
          typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 189
          FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, Char>::value&&
f8deb5b9 Poul Sander 2022-01-15 13:55 190
                            detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 191
inline auto format_to_n(OutputIt out, size_t n, const S& fmt,
f8deb5b9 Poul Sander 2022-01-15 13:55 192
                        const Args&... args) -> format_to_n_result<OutputIt> {
f8deb5b9 Poul Sander 2022-01-15 13:55 193
  const auto& vargs = fmt::make_args_checked<Args...>(fmt, args...);
f8deb5b9 Poul Sander 2022-01-15 13:55 194
  return vformat_to_n(out, n, to_string_view(fmt), vargs);
f8deb5b9 Poul Sander 2022-01-15 13:55 195
}
f8deb5b9 Poul Sander 2022-01-15 13:55 196
f8deb5b9 Poul Sander 2022-01-15 13:55 197
template <typename S, typename... Args, typename Char = char_t<S>,
f8deb5b9 Poul Sander 2022-01-15 13:55 198
          FMT_ENABLE_IF(detail::is_exotic_char<Char>::value)>
f8deb5b9 Poul Sander 2022-01-15 13:55 199
inline auto formatted_size(const S& fmt, Args&&... args) -> size_t {
f8deb5b9 Poul Sander 2022-01-15 13:55 200
  detail::counting_buffer<Char> buf;
f8deb5b9 Poul Sander 2022-01-15 13:55 201
  const auto& vargs = fmt::make_args_checked<Args...>(fmt, args...);
f8deb5b9 Poul Sander 2022-01-15 13:55 202
  detail::vformat_to(buf, to_string_view(fmt), vargs);
f8deb5b9 Poul Sander 2022-01-15 13:55 203
  return buf.count();
f8deb5b9 Poul Sander 2022-01-15 13:55 204
}
f8deb5b9 Poul Sander 2022-01-15 13:55 205
f8deb5b9 Poul Sander 2022-01-15 13:55 206
inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
f8deb5b9 Poul Sander 2022-01-15 13:55 207
  wmemory_buffer buffer;
f8deb5b9 Poul Sander 2022-01-15 13:55 208
  detail::vformat_to(buffer, fmt, args);
f8deb5b9 Poul Sander 2022-01-15 13:55 209
  buffer.push_back(L'\0');
f8deb5b9 Poul Sander 2022-01-15 13:55 210
  if (std::fputws(buffer.data(), f) == -1)
f8deb5b9 Poul Sander 2022-01-15 13:55 211
    FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
f8deb5b9 Poul Sander 2022-01-15 13:55 212
}
f8deb5b9 Poul Sander 2022-01-15 13:55 213
f8deb5b9 Poul Sander 2022-01-15 13:55 214
inline void vprint(wstring_view fmt, wformat_args args) {
f8deb5b9 Poul Sander 2022-01-15 13:55 215
  vprint(stdout, fmt, args);
f8deb5b9 Poul Sander 2022-01-15 13:55 216
}
f8deb5b9 Poul Sander 2022-01-15 13:55 217
f8deb5b9 Poul Sander 2022-01-15 13:55 218
template <typename... T>
f8deb5b9 Poul Sander 2022-01-15 13:55 219
void print(std::FILE* f, wformat_string<T...> fmt, T&&... args) {
f8deb5b9 Poul Sander 2022-01-15 13:55 220
  return vprint(f, wstring_view(fmt), fmt::make_wformat_args(args...));
f8deb5b9 Poul Sander 2022-01-15 13:55 221
}
f8deb5b9 Poul Sander 2022-01-15 13:55 222
f8deb5b9 Poul Sander 2022-01-15 13:55 223
template <typename... T> void print(wformat_string<T...> fmt, T&&... args) {
f8deb5b9 Poul Sander 2022-01-15 13:55 224
  return vprint(wstring_view(fmt), fmt::make_wformat_args(args...));
f8deb5b9 Poul Sander 2022-01-15 13:55 225
}
f8deb5b9 Poul Sander 2022-01-15 13:55 226
f8deb5b9 Poul Sander 2022-01-15 13:55 227
/**
f8deb5b9 Poul Sander 2022-01-15 13:55 228
  Converts *value* to ``std::wstring`` using the default format for type *T*.
f8deb5b9 Poul Sander 2022-01-15 13:55 229
 */
f8deb5b9 Poul Sander 2022-01-15 13:55 230
template <typename T> inline auto to_wstring(const T& value) -> std::wstring {
f8deb5b9 Poul Sander 2022-01-15 13:55 231
  return format(FMT_STRING(L"{}"), value);
f8deb5b9 Poul Sander 2022-01-15 13:55 232
}
f8deb5b9 Poul Sander 2022-01-15 13:55 233
FMT_MODULE_EXPORT_END
f8deb5b9 Poul Sander 2022-01-15 13:55 234
FMT_END_NAMESPACE
f8deb5b9 Poul Sander 2022-01-15 13:55 235
f8deb5b9 Poul Sander 2022-01-15 13:55 236
#endif  // FMT_XCHAR_H_
1970-01-01 00:00 237