19#define FMT_VERSION 80001
22# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
24# define FMT_CLANG_VERSION 0
27#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
28# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
29# define FMT_GCC_PRAGMA(arg) _Pragma(arg)
31# define FMT_GCC_VERSION 0
32# define FMT_GCC_PRAGMA(arg)
35#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
36# define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION
38# define FMT_HAS_GXX_CXX11 0
41#if defined(__INTEL_COMPILER)
42# define FMT_ICC_VERSION __INTEL_COMPILER
44# define FMT_ICC_VERSION 0
48# define FMT_NVCC __NVCC__
54# define FMT_MSC_VER _MSC_VER
55# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
58# define FMT_MSC_WARNING(...)
62# define FMT_HAS_FEATURE(x) __has_feature(x)
64# define FMT_HAS_FEATURE(x) 0
67#if defined(__has_include) && \
68 (!defined(__INTELLISENSE__) || FMT_MSC_VER > 1900) && \
69 (!FMT_ICC_VERSION || FMT_ICC_VERSION >= 1600)
70# define FMT_HAS_INCLUDE(x) __has_include(x)
72# define FMT_HAS_INCLUDE(x) 0
75#ifdef __has_cpp_attribute
76# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
78# define FMT_HAS_CPP_ATTRIBUTE(x) 0
81#define FMT_HAS_CPP14_ATTRIBUTE(attribute) \
82 (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))
84#define FMT_HAS_CPP17_ATTRIBUTE(attribute) \
85 (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))
89#ifndef FMT_USE_CONSTEXPR
90# define FMT_USE_CONSTEXPR \
91 (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \
92 (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \
93 !FMT_NVCC && !FMT_ICC_VERSION
96# define FMT_CONSTEXPR constexpr
97# define FMT_CONSTEXPR_DECL constexpr
100# define FMT_CONSTEXPR_DECL
104#if defined(__GLIBCXX__)
105# if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \
106 _GLIBCXX_RELEASE >= 7
107# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
109#elif defined(_LIBCPP_VERSION) && __cplusplus >= 201703L && \
110 _LIBCPP_VERSION >= 4000
111# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
112#elif FMT_MSC_VER >= 1914 && _MSVC_LANG >= 201703L
113# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
115#ifndef FMT_CONSTEXPR_CHAR_TRAITS
116# define FMT_CONSTEXPR_CHAR_TRAITS
120# if FMT_HAS_FEATURE(cxx_override_control) || \
121 (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900
122# define FMT_OVERRIDE override
129#ifndef FMT_EXCEPTIONS
130# if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \
131 FMT_MSC_VER && !_HAS_EXCEPTIONS
132# define FMT_EXCEPTIONS 0
134# define FMT_EXCEPTIONS 1
139#ifndef FMT_USE_NOEXCEPT
140# define FMT_USE_NOEXCEPT 0
143#if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
144 (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900
145# define FMT_DETECTED_NOEXCEPT noexcept
146# define FMT_HAS_CXX11_NOEXCEPT 1
148# define FMT_DETECTED_NOEXCEPT throw()
149# define FMT_HAS_CXX11_NOEXCEPT 0
153# if FMT_EXCEPTIONS || FMT_HAS_CXX11_NOEXCEPT
154# define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT
162#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && \
164# define FMT_NORETURN [[noreturn]]
169#ifndef FMT_MAYBE_UNUSED
170# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused)
171# define FMT_MAYBE_UNUSED [[maybe_unused]]
173# define FMT_MAYBE_UNUSED
177#if __cplusplus == 201103L || __cplusplus == 201402L
178# if defined(__INTEL_COMPILER) || defined(__PGI)
179# define FMT_FALLTHROUGH
180# elif defined(__clang__)
181# define FMT_FALLTHROUGH [[clang::fallthrough]]
182# elif FMT_GCC_VERSION >= 700 && \
183 (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 520)
184# define FMT_FALLTHROUGH [[gnu::fallthrough]]
186# define FMT_FALLTHROUGH
188#elif FMT_HAS_CPP17_ATTRIBUTE(fallthrough) || \
189 (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
190# define FMT_FALLTHROUGH [[fallthrough]]
192# define FMT_FALLTHROUGH
196# define FMT_USE_FLOAT 1
198#ifndef FMT_USE_DOUBLE
199# define FMT_USE_DOUBLE 1
201#ifndef FMT_USE_LONG_DOUBLE
202# define FMT_USE_LONG_DOUBLE 1
206# if FMT_GCC_VERSION || FMT_CLANG_VERSION
207# define FMT_INLINE inline __attribute__((always_inline))
209# define FMT_INLINE inline
213#ifndef FMT_USE_INLINE_NAMESPACES
214# if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \
215 (FMT_MSC_VER >= 1900 && (!defined(_MANAGED) || !_MANAGED))
216# define FMT_USE_INLINE_NAMESPACES 1
218# define FMT_USE_INLINE_NAMESPACES 0
222#ifndef FMT_BEGIN_NAMESPACE
223# if FMT_USE_INLINE_NAMESPACES
224# define FMT_INLINE_NAMESPACE inline namespace
225# define FMT_END_NAMESPACE \
229# define FMT_INLINE_NAMESPACE namespace
230# define FMT_END_NAMESPACE \
232 using namespace v8; \
235# define FMT_BEGIN_NAMESPACE \
237 FMT_INLINE_NAMESPACE v8 {
240#ifndef FMT_MODULE_EXPORT
241# define FMT_MODULE_EXPORT
242# define FMT_MODULE_EXPORT_BEGIN
243# define FMT_MODULE_EXPORT_END
244# define FMT_BEGIN_DETAIL_NAMESPACE namespace detail {
245# define FMT_END_DETAIL_NAMESPACE }
248#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
249# define FMT_CLASS_API FMT_MSC_WARNING(suppress : 4275)
251# define FMT_API __declspec(dllexport)
252# elif defined(FMT_SHARED)
253# define FMT_API __declspec(dllimport)
256# define FMT_CLASS_API
257# if defined(FMT_EXPORT) || defined(FMT_SHARED)
258# if defined(__GNUC__) || defined(__clang__)
259# define FMT_API __attribute__((visibility("default")))
268# define FMT_GCC_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
270# define FMT_GCC_VISIBILITY_HIDDEN
274#if (FMT_HAS_INCLUDE(<string_view>) && \
275 (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \
276 (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910)
278# define FMT_USE_STRING_VIEW
279#elif FMT_HAS_INCLUDE("experimental/string_view") && __cplusplus >= 201402L
280# include <experimental/string_view>
281# define FMT_USE_EXPERIMENTAL_STRING_VIEW
285# define FMT_UNICODE !FMT_MSC_VER
289# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
290 __cplusplus > 201703L) || \
291 (defined(__cpp_consteval) && \
293# define FMT_CONSTEVAL consteval
294# define FMT_HAS_CONSTEVAL
296# define FMT_CONSTEVAL
300#ifndef FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
301# if defined(__cpp_nontype_template_args) && \
302 ((FMT_GCC_VERSION >= 903 && __cplusplus >= 201709L) || \
303 __cpp_nontype_template_args >= 201911L)
304# define FMT_USE_NONTYPE_TEMPLATE_PARAMETERS 1
306# define FMT_USE_NONTYPE_TEMPLATE_PARAMETERS 0
320template <
bool B,
typename T =
void>
322template <
bool B,
typename T,
typename F>
345# define FMT_ENABLE_IF(...)
347# define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
353#ifdef __cpp_lib_is_constant_evaluated
364 const char* message);
369# define FMT_ASSERT(condition, message) \
370 ::fmt::ignore_unused((condition), (message))
372# define FMT_ASSERT(condition, message) \
375 : ::fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
379#if defined(FMT_USE_STRING_VIEW)
381#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
382template <
typename Char>
390#elif defined(__SIZEOF_INT128__) && !FMT_NVCC && \
391 !(FMT_CLANG_VERSION && FMT_MSC_VER)
392# define FMT_USE_INT128 1
399# define FMT_USE_INT128 0
411template <
typename Int>
423 using uchar =
unsigned char;
424 return FMT_UNICODE || (
sizeof(micro) == 3 && uchar(micro[0]) == 0xC2 &&
425 uchar(micro[1]) == 0xB5);
462 !detail::is_constant_evaluated()))
469 template <
typename Traits,
typename Alloc>
476 S, detail::std_string_view<Char>>
::value)>
481 constexpr auto data() const -> const Char* {
return data_; }
500 size_t str_size =
size_ < other.size_ ?
size_ : other.size_;
503 result =
size_ == other.size_ ? 0 : (
size_ < other.size_ ? -1 : 1);
510 return lhs.compare(rhs) == 0;
513 return lhs.compare(rhs) != 0;
516 return lhs.compare(rhs) < 0;
519 return lhs.compare(rhs) <= 0;
522 return lhs.compare(rhs) > 0;
525 return lhs.compare(rhs) >= 0;
536template <
typename Char, FMT_ENABLE_IF(is_
char<Char>::value)>
540template <
typename Char,
typename Traits,
typename Alloc>
545template <
typename Char>
550template <
typename Char,
552inline auto to_string_view(detail::std_string_view<Char> s)
564template <
typename S, FMT_ENABLE_IF(is_compile_
string<S>::value)>
565constexpr auto to_string_view(
const S& s)
572void to_string_view(...);
573using fmt::v8::to_string_view;
585 using type =
typename result::value_type;
591#ifdef FMT_ENFORCE_COMPILE_STRING
593 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use "
610template <
typename S>
using char_t =
typename detail::char_t_impl<S>::type;
619template <
typename Char,
typename ErrorHandler = detail::error_handler>
662 on_error(
"cannot switch from manual to automatic argument indexing");
672 on_error(
"cannot switch from automatic to manual argument indexing");
680 ErrorHandler::on_error(message);
693template <
typename T,
typename Char =
char,
typename Enable =
void>
701template <
typename T,
typename Context>
707template <
typename Char>
715template <
typename Container>
719 struct accessor : bi_iterator {
720 accessor(bi_iterator iter) : bi_iterator(iter) {}
721 using bi_iterator::container;
723 return *accessor(it).container;
726template <
typename Char,
typename InputIt,
typename OutputIt>
729 while (begin != end) *out++ =
static_cast<Char
>(*begin++);
733template <
typename Char, FMT_ENABLE_IF(std::is_same<Char,
char>::value)>
737 return copy_str<Char, const Char*, Char*>(begin, end, out);
739 memcpy(out, begin, size);
836 auto count() const ->
size_t {
return 0; }
837 auto limit(
size_t size) ->
size_t {
return size; }
851 return size < n ? size : n;
856template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
885 auto count() const ->
size_t {
return Traits::count() + this->
size(); }
899template <
typename Container>
901 enable_if_t<is_contiguous<Container>::value,
902 typename Container::value_type>>
903 final :
public buffer<typename Container::value_type> {
910 this->set(&container_[0],
capacity);
933 count_ += this->
size();
948template <
typename T,
typename OutputIt>
953template <
typename Buffer>
961template <
typename T,
typename Char =
char,
typename Enable =
void>
967template <
typename T,
typename Char>
984template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
988 T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
991 template <
typename... U>
998template <
typename T,
typename Char,
size_t NUM_ARGS>
1003 template <
typename... U>
1011template <
typename Char>
1017template <
typename T,
typename Char>
1020template <
typename Char,
typename T,
typename... Tail,
1023 int named_arg_count,
const T&,
const Tail&... args) {
1027template <
typename Char,
typename T,
typename... Tail,
1030 int named_arg_count,
const T&
arg,
const Tail&... args) {
1031 named_args[named_arg_count++] = {
arg.
name, arg_count};
1035template <
typename... Args>
1039template <
bool B = false>
constexpr auto count() ->
size_t {
return B ? 1 : 0; }
1040template <
bool B1,
bool B2,
bool... Tail>
constexpr auto count() ->
size_t {
1041 return (B1 ? 1 : 0) + count<B2, Tail...>();
1045 return count<is_named_arg<Args>::value...>();
1072template <
typename T,
typename Char>
1075#define FMT_TYPE_CONSTANT(Type, constant) \
1076 template <typename Char> \
1077 struct type_constant<Type, Char> \
1078 : std::integral_constant<type, type::constant> {}
1120template <
typename Context>
class value {
1160 string.data = val.
data();
1161 string.size = val.
size();
1174 typename Context::template formatter_type<T>,
1180 template <
typename T,
typename Formatter>
1182 typename Context::parse_context_type& parse_ctx,
1185 parse_ctx.advance_to(f.parse(parse_ctx));
1186 ctx.advance_to(f.format(*
static_cast<const T*
>(
arg), ctx));
1190template <
typename Context,
typename T>
1221 ->
unsigned long long {
1228 template <
typename T, FMT_ENABLE_IF(is_
char<T>::value)>
1232 "mixing character types is disallowed");
1248 template <
typename T, FMT_ENABLE_IF(is_
string<T>::value)>
1252 "mixing character types is disallowed");
1253 return to_string_view(val);
1255 template <
typename T,
1277 return reinterpret_cast<const char*
>(val);
1281 return reinterpret_cast<const char*
>(val);
1284 const auto* const_val = val;
1285 return map(const_val);
1288 const auto* const_val = val;
1289 return map(const_val);
1302 template <
typename T>
1308 static_assert(!
sizeof(
T),
"formatting of non-void pointers is disallowed");
1312 template <
typename T, std::
size_t N>
1317 template <
typename T,
1326 template <
typename T,
1334 template <
typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
1344template <
typename T,
typename Context>
1347 typename Context::char_type>;
1362 template <
typename T>
1364 return detail::get_container(out);
1391 template <
typename ContextType,
typename T>
1395 template <
typename Visitor,
typename Ctx>
1398 ->
decltype(vis(0));
1405 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1416 void format(
typename Context::parse_context_type& parse_ctx,
1417 Context& ctx)
const {
1428 return type_ != detail::type::none_type;
1435 return detail::is_arithmetic_type(
type_);
1446template <
typename Visitor,
typename Context>
1449 switch (
arg.type_) {
1450 case detail::type::none_type:
1452 case detail::type::int_type:
1453 return vis(
arg.value_.int_value);
1454 case detail::type::uint_type:
1455 return vis(
arg.value_.uint_value);
1456 case detail::type::long_long_type:
1457 return vis(
arg.value_.long_long_value);
1458 case detail::type::ulong_long_type:
1459 return vis(
arg.value_.ulong_long_value);
1460 case detail::type::int128_type:
1461 return vis(detail::convert_for_visit(
arg.value_.int128_value));
1462 case detail::type::uint128_type:
1463 return vis(detail::convert_for_visit(
arg.value_.uint128_value));
1464 case detail::type::bool_type:
1465 return vis(
arg.value_.bool_value);
1466 case detail::type::char_type:
1467 return vis(
arg.value_.char_value);
1468 case detail::type::float_type:
1469 return vis(
arg.value_.float_value);
1470 case detail::type::double_type:
1471 return vis(
arg.value_.double_value);
1472 case detail::type::long_double_type:
1473 return vis(
arg.value_.long_double_value);
1474 case detail::type::cstring_type:
1475 return vis(
arg.value_.string.data);
1476 case detail::type::string_type:
1478 return vis(sv(
arg.value_.string.data,
arg.value_.string.size));
1479 case detail::type::pointer_type:
1480 return vis(
arg.value_.pointer);
1481 case detail::type::custom_type:
1489template <
typename Char,
typename InputIt>
1495#if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
1497template <
typename... Ts>
struct void_t_impl {
using type = void; };
1498template <
typename... Ts>
1499using void_t =
typename detail::void_t_impl<Ts...>
::type;
1504template <
typename It,
typename T,
typename Enable =
void>
1507template <
typename It,
typename T>
1512 :
std::true_type {};
1514template <
typename OutputIt>
1516template <
typename Container>
1520template <
typename OutputIt>
1522template <
typename Container>
1535 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1539 template <
typename Locale>
auto get() const -> Locale;
1546template <
typename Context,
typename Arg,
typename... Args>
1552template <
typename Context,
typename T>
1563template <
bool IS_PACKED,
typename Context,
type,
typename T,
1569 "Cannot format an argument. To make type T formattable provide a "
1570 "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
1574template <
bool IS_PACKED,
typename Context,
type,
typename T,
1577 return make_arg<Context>(
value);
1607 detail::locale_ref loc = detail::locale_ref())
1608 : out_(out), args_(ctx_args), loc_(loc) {}
1629 if (!detail::is_back_insert_iterator<iterator>()) out_ = it;
1635template <
typename Char>
1641#define FMT_BUFFER_CONTEXT(Char) \
1642 basic_format_context<detail::buffer_appender<Char>, Char>
1644template <
typename T,
typename Char =
char>
1646 !
std::is_same<
decltype(detail::arg_mapper<buffer_context<Char>>().map(
1648 detail::unformattable>
::value &&
1649 !detail::has_fallback_formatter<T, Char>::value>;
1658template <
typename Context,
typename... Args>
1666 static const size_t num_args =
sizeof...(Args);
1667 static const size_t num_named_args = detail::count_named_args<Args...>();
1668 static const bool is_packed = num_args <= detail::max_packed_args;
1673 detail::arg_data<
value_type,
typename Context::char_type, num_args,
1679 static constexpr unsigned long long desc =
1680 (is_packed ? detail::encode_types<Context, Args...>()
1682 (num_named_args != 0
1695 detail::init_named_args(data_.named_args(), 0, 0, args...);
1724template <
typename Char,
typename T>
1725inline auto arg(
const Char*
name,
const T&
arg) -> detail::named_arg<Char, T> {
1726 static_assert(!detail::is_named_arg<T>(),
"nested named arguments");
1762 return (desc_ & detail::is_unpacked_bit) == 0;
1765 return (desc_ & detail::has_named_args_bit) != 0;
1769 int shift =
index * detail::packed_arg_bits;
1770 unsigned int mask = (1 << detail::packed_arg_bits) - 1;
1771 return static_cast<detail::type
>((desc_ >> shift) & mask);
1775 const detail::value<Context>* values)
1776 : desc_(desc), values_(values) {}
1778 : desc_(desc), args_(args) {}
1788 template <
typename... Args>
1792 store.data_.args()) {}
1817 if (
id < max_size())
arg = args_[id];
1820 if (
id >= detail::max_packed_args)
return arg;
1822 if (
arg.type_ == detail::type::none_type)
return arg;
1823 arg.value_ = values_[id];
1827 template <
typename Char>
1829 int id = get_id(
name);
1833 template <
typename Char>
1835 if (!has_named_args())
return -1;
1836 const auto& named_args =
1837 (is_packed() ? values_[-1] : args_[-1].value_).named_args;
1838 for (
size_t i = 0; i < named_args.size; ++i) {
1839 if (named_args.data[i].name ==
name)
return named_args.data[i].id;
1845 unsigned long long max_packed = detail::max_packed_args;
1846 return static_cast<int>(is_packed() ? max_packed
1874 enum { max_size = 4 };
1875 Char data_[max_size] = {Char(
' '), Char(0), Char(0), Char(0)};
1876 unsigned char size_ = 1;
1880 auto size = s.
size();
1882 for (
size_t i = 0; i < size; ++i) data_[i] = s[i];
1883 size_ =
static_cast<unsigned char>(size);
1886 constexpr auto size() const ->
size_t {
return size_; }
1887 constexpr auto data() const -> const Char* {
return data_; }
1891 return data_[
index];
1951template <
typename Char>
1969 : specs_(other.specs_) {}
1981 specs_.
fill[0] = Char(
'0');
1991 specs_.
type =
static_cast<char>(
type);
1997template <
typename ParseContext>
1999 :
public specs_setter<typename ParseContext::char_type> {
2009 specs_(other.specs_),
2010 context_(other.context_) {}
2013 specs_.width_ref = make_arg_ref(arg_id);
2017 specs_.precision_ref = make_arg_ref(arg_id);
2021 context_.on_error(message);
2031 context_.check_arg_id(arg_id);
2041 context_.check_arg_id(arg_id);
2043 context_.begin(),
to_unsigned(context_.end() - context_.begin()));
2049 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z');
2053template <
typename Char, FMT_ENABLE_IF(std::is_
integral<Char>::value)>
2057template <
typename Char, FMT_ENABLE_IF(std::is_enum<Char>::value)>
2063template <
typename Char>
2066 constexpr char lengths[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2067 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 3, 3, 4, 0};
2068 int len = lengths[
static_cast<unsigned char>(*begin) >> 3];
2077template <
bool IS_CONSTEXPR,
typename T,
typename Ptr = const T*>
2079 for (out = first; out != last; ++out) {
2080 if (*out ==
value)
return true;
2087 const char*& out) ->
bool {
2088 out =
static_cast<const char*
>(
2090 return out !=
nullptr;
2095template <
typename Char>
2097 int error_value)
noexcept ->
int {
2098 FMT_ASSERT(begin != end &&
'0' <= *begin && *begin <=
'9',
"");
2099 unsigned value = 0, prev = 0;
2105 }
while (p != end &&
'0' <= *p && *p <=
'9');
2106 auto num_digits = p - begin;
2109 return static_cast<int>(
value);
2113 prev * 10ull + unsigned(p[-1] -
'0') <= max
2114 ?
static_cast<int>(
value)
2119template <
typename Char,
typename Handler>
2121 Handler&& handler) ->
const Char* {
2125 if (p >= end) p = begin;
2144 return handler.on_error(
"invalid fill character '{'"), begin;
2149 handler.on_align(
align);
2151 }
else if (p == begin) {
2160 return (
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z') ||
'_' == c;
2163template <
typename Char,
typename IDHandler>
2165 IDHandler&& handler) ->
const Char* {
2168 if (c >=
'0' && c <=
'9') {
2175 if (begin == end || (*begin !=
'}' && *begin !=
':'))
2176 handler.on_error(
"invalid format string");
2182 handler.on_error(
"invalid format string");
2188 }
while (it != end && (
is_name_start(c = *it) || (
'0' <= c && c <=
'9')));
2193template <
typename Char,
typename IDHandler>
2195 IDHandler&& handler) ->
const Char* {
2197 if (c !=
'}' && c !=
':')
return do_parse_arg_id(begin, end, handler);
2202template <
typename Char,
typename Handler>
2204 Handler&& handler) ->
const Char* {
2205 using detail::auto_id;
2206 struct width_adapter {
2210 FMT_CONSTEXPR void operator()(
int id) { handler.on_dynamic_width(
id); }
2212 handler.on_dynamic_width(
id);
2215 if (message) handler.on_error(message);
2220 if (
'0' <= *begin && *begin <=
'9') {
2223 handler.on_width(width);
2225 handler.on_error(
"number is too big");
2226 }
else if (*begin ==
'{') {
2228 if (begin != end) begin =
parse_arg_id(begin, end, width_adapter{handler});
2229 if (begin == end || *begin !=
'}')
2230 return handler.on_error(
"invalid format string"), begin;
2236template <
typename Char,
typename Handler>
2238 Handler&& handler) ->
const Char* {
2239 using detail::auto_id;
2240 struct precision_adapter {
2244 FMT_CONSTEXPR void operator()(
int id) { handler.on_dynamic_precision(
id); }
2246 handler.on_dynamic_precision(
id);
2249 if (message) handler.on_error(message);
2254 auto c = begin != end ? *begin : Char();
2255 if (
'0' <= c && c <=
'9') {
2257 if (precision != -1)
2258 handler.on_precision(precision);
2260 handler.on_error(
"number is too big");
2261 }
else if (c ==
'{') {
2264 begin =
parse_arg_id(begin, end, precision_adapter{handler});
2265 if (begin == end || *begin++ !=
'}')
2266 return handler.on_error(
"invalid format string"), begin;
2268 return handler.on_error(
"missing precision specifier"), begin;
2270 handler.end_precision();
2276template <
typename Char,
typename SpecHandler>
2279 SpecHandler&& handler)
2283 handler.on_type(*begin++);
2287 if (begin == end)
return begin;
2290 if (begin == end)
return begin;
2309 if (begin == end)
return begin;
2311 if (*begin ==
'#') {
2313 if (++begin == end)
return begin;
2317 if (*begin ==
'0') {
2319 if (++begin == end)
return begin;
2323 if (begin == end)
return begin;
2326 if (*begin ==
'.') {
2328 if (begin == end)
return begin;
2331 if (*begin ==
'L') {
2332 handler.on_localized();
2337 if (begin != end && *begin !=
'}') handler.on_type(*begin++);
2341template <
typename Char,
typename Handler>
2343 Handler&& handler) ->
const Char* {
2348 FMT_CONSTEXPR void operator()() { arg_id = handler.on_arg_id(); }
2349 FMT_CONSTEXPR void operator()(
int id) { arg_id = handler.on_arg_id(
id); }
2351 arg_id = handler.on_arg_id(
id);
2354 if (message) handler.on_error(message);
2359 if (begin == end)
return handler.on_error(
"invalid format string"), end;
2360 if (*begin ==
'}') {
2361 handler.on_replacement_field(handler.on_arg_id(), begin);
2362 }
else if (*begin ==
'{') {
2363 handler.on_text(begin, begin + 1);
2365 auto adapter = id_adapter{handler, 0};
2367 Char c = begin != end ? *begin : Char();
2369 handler.on_replacement_field(adapter.arg_id, begin);
2370 }
else if (c ==
':') {
2371 begin = handler.on_format_specs(adapter.arg_id, begin + 1, end);
2372 if (begin == end || *begin !=
'}')
2373 return handler.on_error(
"unknown format specifier"), end;
2375 return handler.on_error(
"missing '}' in format string"), end;
2381template <
bool IS_CONSTEXPR,
typename Char,
typename Handler>
2387 auto begin = format_str.
data();
2388 auto end = begin + format_str.
size();
2389 if (end - begin < 32) {
2391 const Char* p = begin;
2395 handler.on_text(begin, p - 1);
2397 }
else if (c ==
'}') {
2398 if (p == end || *p !=
'}')
2399 return handler.on_error(
"unmatched '}' in format string");
2400 handler.on_text(begin, p);
2404 handler.on_text(begin, end);
2408 FMT_CONSTEXPR void operator()(
const Char* pbegin,
const Char* pend) {
2409 if (pbegin == pend)
return;
2411 const Char* p =
nullptr;
2412 if (!find<IS_CONSTEXPR>(pbegin, pend, Char(
'}'), p))
2413 return handler_.on_text(pbegin, pend);
2415 if (p == pend || *p !=
'}')
2416 return handler_.
on_error(
"unmatched '}' in format string");
2417 handler_.on_text(pbegin, p);
2423 while (begin != end) {
2426 const Char* p = begin;
2427 if (*begin !=
'{' && !find<IS_CONSTEXPR>(begin + 1, end, Char(
'{'), p))
2428 return write(begin, end);
2434template <
typename T,
typename ParseContext>
2436 ->
decltype(ctx.begin()) {
2437 using char_type =
typename ParseContext::char_type;
2445 return f.parse(ctx);
2452template <
typename Char,
typename ErrorHandler = error_handler>
2463 : base(format_str, eh), num_args_(num_args) {}
2466 int id = base::next_arg_id();
2467 if (
id >= num_args_) this->on_error(
"argument not found");
2472 base::check_arg_id(
id);
2473 if (
id >= num_args_) this->on_error(
"argument not found");
2475 using base::check_arg_id;
2478template <
typename ErrorHandler>
2491 eh.on_error(
"invalid type specifier");
2497template <
typename Char,
typename ErrorHandler = error_handler>
2499 ErrorHandler&& eh = {}) ->
bool {
2500 if (specs.
type && specs.
type !=
'c') {
2505 eh.on_error(
"invalid format specifier for char");
2528template <
typename ErrorHandler = error_handler,
typename Char>
2530 ErrorHandler&& eh = {})
2535 switch (specs.
type) {
2566 eh.on_error(
"invalid type specifier");
2572template <
typename Char,
typename ErrorHandler = error_handler>
2575 if (spec == 0 || spec ==
's')
return true;
2576 if (spec !=
'p') eh.on_error(
"invalid type specifier");
2580template <
typename Char,
typename ErrorHandler = error_handler>
2582 if (spec != 0 && spec !=
's') eh.on_error(
"invalid type specifier");
2585template <
typename Char,
typename ErrorHandler>
2587 if (spec != 0 && spec !=
'p') eh.on_error(
"invalid type specifier");
2598 this->on_error(
"format specifier requires numeric argument");
2603 :
Handler(handler), arg_type_(arg_type) {}
2607 Handler::on_align(
align);
2611 require_numeric_argument();
2614 this->on_error(
"format specifier requires signed argument");
2616 Handler::on_sign(s);
2620 require_numeric_argument();
2625 require_numeric_argument();
2626 Handler::on_localized();
2630 require_numeric_argument();
2636 this->on_error(
"precision not allowed for this argument type");
2642#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2643template <
int N,
typename T,
typename... Args,
typename Char>
2645 if constexpr (detail::is_statically_named_arg<T>()) {
2646 if (
name == T::name)
return N;
2648 if constexpr (
sizeof...(Args) > 0) {
2657template <
typename... Args,
typename Char>
2659#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2660 if constexpr (
sizeof...(Args) > 0) {
2672template <
typename Char,
typename ErrorHandler,
typename... Args>
2676 enum { num_args =
sizeof...(Args) };
2687 : context_(format_str, num_args, eh),
2697#if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2703 on_error(
"compile-time checks for named arguments require C++20 support");
2714 return id >= 0 &&
id < num_args ? parse_funcs_[id](context_) : begin;
2722template <
typename... Args,
typename S,
2729 (parse_format_string<true>(s, checker(s, {})),
true);
2733template <
typename Char>
2747template <
typename T,
typename Char>
2749 enable_if_t<detail::type_constant<T, Char>::value !=
2750 detail::type::custom_type>> {
2757 template <
typename ParseContext>
2759 auto begin = ctx.begin(), end = ctx.end();
2760 if (begin == end)
return begin;
2761 using handler_type = detail::dynamic_specs_handler<ParseContext>;
2762 auto type = detail::type_constant<T, Char>::value;
2764 detail::specs_checker<handler_type>(handler_type(specs_, ctx),
type);
2765 auto it = detail::parse_format_specs(begin, end, checker);
2766 auto eh = ctx.error_handler();
2768 case detail::type::none_type:
2771 case detail::type::bool_type:
2772 if (!specs_.type || specs_.type ==
's')
break;
2774 case detail::type::int_type:
2775 case detail::type::uint_type:
2776 case detail::type::long_long_type:
2777 case detail::type::ulong_long_type:
2778 case detail::type::int128_type:
2779 case detail::type::uint128_type:
2780 detail::check_int_type_spec(specs_.type, eh);
2782 case detail::type::char_type:
2783 detail::check_char_specs(specs_, eh);
2785 case detail::type::float_type:
2787 detail::parse_float_type_spec(specs_, eh);
2791 case detail::type::double_type:
2793 detail::parse_float_type_spec(specs_, eh);
2795 FMT_ASSERT(
false,
"double support disabled");
2797 case detail::type::long_double_type:
2799 detail::parse_float_type_spec(specs_, eh);
2801 FMT_ASSERT(
false,
"long double support disabled");
2803 case detail::type::cstring_type:
2804 detail::check_cstring_type_spec(specs_.type, eh);
2806 case detail::type::string_type:
2807 detail::check_string_type_spec(specs_.type, eh);
2809 case detail::type::pointer_type:
2810 detail::check_pointer_type_spec(specs_.type, eh);
2812 case detail::type::custom_type:
2820 template <
typename FormatContext>
2822 ->
decltype(ctx.out());
2832 template <
typename S,
2840 "passing views as lvalues is disallowed");
2841#ifdef FMT_HAS_CONSTEVAL
2842 if constexpr (detail::count_named_args<Args...>() == 0) {
2843 using checker = detail::format_string_checker<Char, detail::error_handler,
2845 detail::parse_format_string<true>(str_, checker(s, {}));
2848 detail::check_format_string<Args...>(s);
2856#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
2863template <
typename... Args>
2884template <
typename...
T>
2886 return vformat(
fmt, fmt::make_format_args(args...));
2890template <
typename OutputIt,
2891 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
2893 using detail::get_buffer;
2894 auto&& buf = get_buffer<char>(out);
2896 return detail::get_iterator(buf);
2911template <
typename OutputIt,
typename...
T,
2912 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
2915 return vformat_to(out,
fmt, fmt::make_format_args(args...));
2925template <
typename OutputIt,
typename...
T,
2926 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
2930 detail::iterator_buffer<OutputIt, char, detail::fixed_buffer_traits>;
2931 auto buf =
buffer(out, n);
2932 detail::vformat_to(buf,
fmt, args, {});
2933 return {buf.out(), buf.count()};
2943template <
typename OutputIt,
typename...
T,
2944 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt, char>::value)>
2951template <
typename...
T>
2953 auto buf = detail::counting_buffer<>();
2954 detail::vformat_to(buf,
string_view(
fmt), fmt::make_format_args(args...), {});
2971template <
typename...
T>
2973 const auto& vargs = fmt::make_format_args(args...);
2974 return detail::is_utf8() ?
vprint(
fmt, vargs)
2975 : detail::vprint_mojibake(stdout,
fmt, vargs);
2988template <
typename...
T>
2990 const auto& vargs = fmt::make_format_args(args...);
2991 return detail::is_utf8() ?
vprint(f,
fmt, vargs)
2992 : detail::vprint_mojibake(f,
fmt, vargs);
2999#ifdef FMT_HEADER_ONLY
T back_inserter(T... args)
auto operator++(int) -> appender
auto operator++() -> appender &
friend auto get_buffer(appender out) -> detail::buffer< char > &
basic_format_context(const basic_format_context &)=delete
FMT_CONSTEXPR auto locale() -> detail::locale_ref
FMT_CONSTEXPR auto out() -> iterator
FMT_CONSTEXPR auto arg(basic_string_view< char_type > name) -> format_arg
FMT_CONSTEXPR auto arg_id(basic_string_view< char_type > name) -> int
void on_error(const char *message)
FMT_CONSTEXPR auto error_handler() -> detail::error_handler
constexpr auto arg(int id) const -> format_arg
auto args() const -> const basic_format_args< basic_format_context > &
void advance_to(iterator it)
constexpr basic_format_context(OutputIt out, basic_format_args< basic_format_context > ctx_args, detail::locale_ref loc=detail::locale_ref())
basic_format_context(basic_format_context &&)=default
void operator=(const basic_format_context &)=delete
basic_format_args< basic_format_context > args_
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
constexpr auto error_handler() const -> ErrorHandler
basic_string_view< Char > format_str_
FMT_CONSTEXPR void on_error(const char *message)
constexpr auto end() const FMT_NOEXCEPT -> iterator
FMT_CONSTEXPR void check_arg_id(int)
typename basic_string_view< Char >::iterator iterator
FMT_CONSTEXPR auto next_arg_id() -> int
FMT_CONSTEXPR void advance_to(iterator it)
constexpr basic_format_parse_context(basic_string_view< Char > format_str, ErrorHandler eh={}, int next_arg_id=0)
constexpr auto begin() const FMT_NOEXCEPT -> iterator
constexpr basic_string_view(const Char *s, size_t count) FMT_NOEXCEPT
FMT_CONSTEXPR void remove_prefix(size_t n)
FMT_CONSTEXPR basic_string_view(const std::basic_string< Char, Traits, Alloc > &s) FMT_NOEXCEPT
FMT_CONSTEXPR_CHAR_TRAITS friend auto operator==(basic_string_view lhs, basic_string_view rhs) -> bool
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool
constexpr basic_string_view() FMT_NOEXCEPT
constexpr auto end() const -> iterator
constexpr auto data() const -> const Char *
FMT_CONSTEXPR basic_string_view(S s) FMT_NOEXCEPT
constexpr auto operator[](size_t pos) const -> const Char &
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR_CHAR_TRAITS FMT_INLINE basic_string_view(const Char *s)
constexpr auto size() const -> size_t
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool
constexpr auto begin() const -> iterator
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int
auto end() FMT_NOEXCEPT -> T *
void append(const U *begin, const U *end)
auto size() const FMT_NOEXCEPT -> size_t
auto end() const FMT_NOEXCEPT -> const T *
auto operator[](I index) -> T &
buffer(const buffer &)=delete
auto operator[](I index) const -> const T &
void set(T *buf_data, size_t buf_capacity) FMT_NOEXCEPT
auto begin() FMT_NOEXCEPT -> T *
void try_reserve(size_t new_capacity)
auto data() const FMT_NOEXCEPT -> const T *
const T & const_reference
void push_back(const T &value)
buffer(T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT
FMT_MSC_WARNING(suppress :26495) buffer(size_t sz) FMT_NOEXCEPT
virtual void grow(size_t capacity)=0
void try_resize(size_t count)
auto capacity() const FMT_NOEXCEPT -> size_t
void operator=(const buffer &)=delete
buffer(buffer &&)=default
auto begin() const FMT_NOEXCEPT -> const T *
auto data() FMT_NOEXCEPT -> T *
FMT_CONSTEXPR void check_arg_id(int id)
FMT_CONSTEXPR compile_parse_context(basic_string_view< Char > format_str, int num_args=(std::numeric_limits< int >::max)(), ErrorHandler eh={})
FMT_CONSTEXPR auto next_arg_id() -> int
void grow(size_t) final FMT_OVERRIDE
typename ParseContext::char_type char_type
FMT_CONSTEXPR dynamic_specs_handler(const dynamic_specs_handler &other)
dynamic_format_specs< char_type > & specs_
FMT_CONSTEXPR dynamic_specs_handler(dynamic_format_specs< char_type > &specs, ParseContext &ctx)
FMT_CONSTEXPR void on_dynamic_precision(Id arg_id)
FMT_CONSTEXPR auto make_arg_ref(int arg_id) -> arg_ref_type
FMT_CONSTEXPR void on_error(const char *message)
FMT_CONSTEXPR void on_dynamic_width(Id arg_id)
FMT_CONSTEXPR auto make_arg_ref(auto_id) -> arg_ref_type
FMT_CONSTEXPR auto make_arg_ref(basic_string_view< char_type > arg_id) -> arg_ref_type
fixed_buffer_traits(size_t limit)
auto limit(size_t size) -> size_t
auto count() const -> size_t
iterator_buffer(T *out, size_t=0)
void grow(size_t) final FMT_OVERRIDE
void grow(size_t capacity) final FMT_OVERRIDE
iterator_buffer(Container &c)
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
auto out() -> std::back_insert_iterator< Container >
iterator_buffer(OutputIt out, size_t n=buffer_size)
auto count() const -> size_t
iterator_buffer(iterator_buffer &&other)
void grow(size_t) final FMT_OVERRIDE
auto get() const -> Locale
FMT_CONSTEXPR void end_precision()
FMT_CONSTEXPR void on_zero()
FMT_CONSTEXPR specs_checker(const Handler &handler, detail::type arg_type)
FMT_CONSTEXPR void on_align(align_t align)
FMT_CONSTEXPR void on_hash()
FMT_CONSTEXPR void require_numeric_argument()
FMT_CONSTEXPR void on_sign(sign_t s)
FMT_CONSTEXPR void on_localized()
FMT_CONSTEXPR void on_sign(sign_t s)
basic_format_specs< Char > & specs_
FMT_CONSTEXPR void on_precision(int precision)
FMT_CONSTEXPR specs_setter(basic_format_specs< Char > &specs)
FMT_CONSTEXPR void on_hash()
FMT_CONSTEXPR void on_zero()
FMT_CONSTEXPR void on_localized()
FMT_CONSTEXPR specs_setter(const specs_setter &other)
FMT_CONSTEXPR void on_width(int width)
FMT_CONSTEXPR void end_precision()
FMT_CONSTEXPR void on_type(Char type)
FMT_CONSTEXPR void on_align(align_t align)
FMT_CONSTEXPR void on_fill(basic_string_view< Char > fill)
FMT_CONSTEXPR FMT_INLINE value(const char_type *val)
long double long_double_value
constexpr FMT_INLINE value(char_type val)
long long long_long_value
constexpr FMT_INLINE value()
constexpr FMT_INLINE value(bool val)
constexpr FMT_INLINE value(int val)
constexpr FMT_INLINE value(unsigned long long val)
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
constexpr FMT_INLINE value(unsigned val)
constexpr FMT_INLINE value(long long val)
FMT_INLINE value(uint128_t val)
FMT_CONSTEXPR FMT_INLINE value(const T &val)
unsigned long long ulong_long_value
FMT_INLINE value(double val)
FMT_INLINE value(int128_t val)
typename Context::char_type char_type
FMT_INLINE value(long double val)
FMT_INLINE value(const void *val)
FMT_INLINE value(float val)
FMT_CONSTEXPR FMT_INLINE value(basic_string_view< char_type > val)
custom_value< Context > custom
named_arg_value< char_type > named_args
static void format_custom_arg(const void *arg, typename Context::parse_context_type &parse_ctx, Context &ctx)
string_value< char_type > string
FMT_CONSTEXPR bool is_name_start(Char c)
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
FMT_CONSTEXPR void ignore_unused(const T &...)
#define FMT_ASSERT(condition, message)
FMT_CONSTEXPR FMT_INLINE auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
FMT_CONSTEXPR auto copy_str(InputIt begin, InputIt end, OutputIt out) -> OutputIt
FMT_CONSTEXPR FMT_INLINE auto parse_format_specs(const Char *begin, const Char *end, SpecHandler &&handler) -> const Char *
FMT_CONSTEXPR auto code_point_length(const Char *begin) -> int
FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string< T... > fmt, const T &... args) -> format_to_n_result< OutputIt >
#define FMT_USE_LONG_DOUBLE
#define FMT_TYPE_CONSTANT(Type, constant)
constexpr bool is_ascii_letter(Char c)
basic_string_view< char > string_view
FMT_CONSTEXPR auto parse_replacement_field(const Char *begin, const Char *end, Handler &&handler) -> const Char *
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
conditional_t< long_short, unsigned, unsigned long long > ulong_type
FMT_CONSTEXPR auto check_char_specs(const basic_format_specs< Char > &specs, ErrorHandler &&eh={}) -> bool
FMT_CONSTEXPR void check_string_type_spec(Char spec, ErrorHandler &&eh={})
void init_named_args(named_arg_info< Char > *, int, int)
typename std::remove_reference< T >::type remove_reference_t
typename detail::char_t_impl< S >::type char_t
#define FMT_END_DETAIL_NAMESPACE
buffer_context< char > format_context
#define FMT_MODULE_EXPORT_BEGIN
FMT_INLINE auto formatted_size(format_string< T... > fmt, T &&... args) -> size_t
FMT_API void vprint(string_view fmt, format_args args)
auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
FMT_CONSTEXPR auto parse_precision(const Char *begin, const Char *end, Handler &&handler) -> const Char *
auto runtime(const S &s) -> basic_runtime< char_t< S > >
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
constexpr auto count() -> size_t
FMT_CONSTEXPR auto check_cstring_type_spec(Char spec, ErrorHandler &&eh={}) -> bool
FMT_INLINE void print(format_string< T... > fmt, T &&... args)
constexpr auto count_named_args() -> size_t
#define FMT_GCC_PRAGMA(arg)
FMT_INLINE auto format(format_string< T... > fmt, T &&... args) -> std::string
FMT_CONSTEXPR FMT_INLINE void parse_format_string(basic_string_view< Char > format_str, Handler &&handler)
constexpr auto to_ascii(Char value) -> Char
FMT_CONSTEXPR auto parse_width(const Char *begin, const Char *end, Handler &&handler) -> const Char *
constexpr bool is_integral_type(type t)
FMT_CONSTEXPR void check_pointer_type_spec(Char spec, ErrorHandler &&eh)
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
#define FMT_BEGIN_NAMESPACE
conditional_t< long_short, int, long long > long_type
FMT_CONSTEXPR auto do_parse_arg_id(const Char *begin, const Char *end, IDHandler &&handler) -> const Char *
#define FMT_BEGIN_DETAIL_NAMESPACE
constexpr auto const_check(T value) -> T
FMT_INLINE void check_format_string(const S &)
void vformat_to(buffer< Char > &buf, basic_string_view< Char > fmt, basic_format_args< FMT_BUFFER_CONTEXT(type_identity_t< Char >)> args, locale_ref loc={})
constexpr auto encode_types() -> unsigned long long
FMT_BEGIN_DETAIL_NAMESPACE auto get_container(std::back_insert_iterator< Container > it) -> Container &
#define FMT_BUFFER_CONTEXT(Char)
constexpr auto is_utf8() -> bool
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T > > > buffer_appender
FMT_BEGIN_DETAIL_NAMESPACE void throw_format_error(const char *message)
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
#define FMT_ENABLE_IF(...)
#define FMT_CONSTEXPR_CHAR_TRAITS
auto get_iterator(Buffer &buf) -> decltype(buf.out())
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
auto convert_for_visit(T) -> monostate
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id(const Char *begin, const Char *end, IDHandler &&handler) -> const Char *
FMT_CONSTEXPR auto parse_nonnegative_int(const Char *&begin, const Char *end, int error_value) noexcept -> int
#define FMT_MSC_WARNING(...)
typename type_identity< T >::type type_identity_t
FMT_BEGIN_DETAIL_NAMESPACE constexpr FMT_INLINE auto is_constant_evaluated() FMT_NOEXCEPT -> bool
FMT_INLINE auto format_to(OutputIt out, format_string< T... > fmt, T &&... args) -> OutputIt
typename std::conditional< B, T, F >::type conditional_t
FMT_CONSTEXPR void check_int_type_spec(char spec, ErrorHandler &&eh)
constexpr auto make_format_args(const Args &... args) -> format_arg_store< Context, Args... >
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
constexpr int invalid_arg_index
#define FMT_END_NAMESPACE
constexpr bool is_arithmetic_type(type t)
#define FMT_MODULE_EXPORT_END
FMT_CONSTEXPR auto make_arg(const T &value) -> basic_format_arg< Context >
FMT_CONSTEXPR auto parse_float_type_spec(const basic_format_specs< Char > &specs, ErrorHandler &&eh={}) -> float_specs
FMT_API auto vformat(string_view fmt, format_args args) -> std::string
auto find< false, char >(const char *first, const char *last, char value, const char *&out) -> bool
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view< Char > name) -> int
FMT_CONSTEXPR auto parse_align(const Char *begin, const Char *end, Handler &&handler) -> const Char *
T is_constant_evaluated(T... args)
FMT_CONSTEXPR FMT_INLINE auto named_args() -> std::nullptr_t
FMT_CONSTEXPR FMT_INLINE auto args() const -> const T *
FMT_CONSTEXPR FMT_INLINE arg_data(const U &... init)
T args_[1+(NUM_ARGS !=0 ? NUM_ARGS :+1)]
arg_data(const arg_data &other)=delete
auto args() const -> const T *
auto named_args() -> named_arg_info< Char > *
named_arg_info< Char > named_args_[NUM_NAMED_ARGS]
arg_data(const U &... init)
FMT_CONSTEXPR FMT_INLINE auto map(float val) -> float
FMT_CONSTEXPR FMT_INLINE auto map(long double val) -> long double
FMT_CONSTEXPR FMT_INLINE auto map(int128_t val) -> int128_t
FMT_CONSTEXPR FMT_INLINE auto map(unsigned val) -> unsigned
typename Context::char_type char_type
auto map(...) -> unformattable
FMT_CONSTEXPR FMT_INLINE auto map(double val) -> double
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long val) -> ulong_type
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char *val) -> const char *
FMT_CONSTEXPR FMT_INLINE auto map(const char_type *val) -> const char_type *
FMT_CONSTEXPR FMT_INLINE auto map(int val) -> int
FMT_CONSTEXPR FMT_INLINE auto map(const unsigned char *val) -> const char *
FMT_CONSTEXPR FMT_INLINE auto map(long long val) -> long long
FMT_CONSTEXPR FMT_INLINE auto map(const T(&values)[N]) -> const T(&)[N]
FMT_CONSTEXPR FMT_INLINE auto map(char_type *val) -> const char_type *
FMT_CONSTEXPR FMT_INLINE auto map(signed char val) -> int
FMT_CONSTEXPR FMT_INLINE auto map(std::nullptr_t val) -> const void *
FMT_CONSTEXPR FMT_INLINE auto map(bool val) -> bool
FMT_CONSTEXPR FMT_INLINE auto map(const signed char *val) -> const char *
FMT_CONSTEXPR FMT_INLINE auto map(unsigned short val) -> unsigned
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> basic_string_view< char_type >
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> decltype(std::declval< arg_mapper >().map(static_cast< typename std::underlying_type< T >::type >(val)))
FMT_CONSTEXPR FMT_INLINE auto map(void *val) -> const void *
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long long val) -> unsigned long long
FMT_CONSTEXPR FMT_INLINE auto map(long val) -> long_type
FMT_CONSTEXPR FMT_INLINE auto map(T val) -> char_type
FMT_CONSTEXPR FMT_INLINE auto map(short val) -> int
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> const T &
FMT_CONSTEXPR FMT_INLINE auto map(const void *val) -> const void *
FMT_CONSTEXPR FMT_INLINE auto map(signed char *val) -> const char *
FMT_CONSTEXPR auto map(T) -> enable_if_t< std::is_pointer< T >::value, int >
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char val) -> unsigned
FMT_CONSTEXPR FMT_INLINE auto map(uint128_t val) -> uint128_t
FMT_CONSTEXPR FMT_INLINE auto map(const T &named_arg) -> decltype(std::declval< arg_mapper >().map(named_arg.value))
FMT_CONSTEXPR arg_ref(basic_string_view< Char > name)
FMT_CONSTEXPR auto operator=(int idx) -> arg_ref &
FMT_CONSTEXPR arg_ref(int index)
basic_string_view< Char > str
auto limit(size_t size) -> size_t
auto count() const -> size_t
decltype(to_string_view(std::declval< S >())) result
typename result::value_type type
void(* format)(const void *arg, parse_context &parse_ctx, Context &ctx)
typename Context::parse_context_type parse_context
constexpr error_handler()=default
FMT_NORETURN FMT_API void on_error(const char *message)
constexpr error_handler(const error_handler &)=default
FMT_CONSTEXPR void operator=(basic_string_view< Char > s)
FMT_CONSTEXPR auto operator[](size_t index) const -> const Char &
constexpr auto size() const -> size_t
constexpr auto data() const -> const Char *
FMT_CONSTEXPR auto operator[](size_t index) -> Char &
const named_arg_info< Char > * data
named_arg(const Char *n, const T &v)
basic_string_view< Char > name
FMT_CONSTEXPR value(basic_string_view< Char > n)
FMT_CONSTEXPR value(int id=0)