21#define FMT_VERSION 100201
23#if defined(__clang__) && !defined(__ibmxl__)
24# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
26# define FMT_CLANG_VERSION 0
29#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && \
30 !defined(__NVCOMPILER)
31# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
33# define FMT_GCC_VERSION 0
38# if FMT_GCC_VERSION >= 504
39# define FMT_GCC_PRAGMA(arg) _Pragma(arg)
41# define FMT_GCC_PRAGMA(arg)
46# define FMT_ICC_VERSION __ICL
47#elif defined(__INTEL_COMPILER)
48# define FMT_ICC_VERSION __INTEL_COMPILER
50# define FMT_ICC_VERSION 0
54# define FMT_MSC_VERSION _MSC_VER
55# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
57# define FMT_MSC_VERSION 0
58# define FMT_MSC_WARNING(...)
62# define FMT_CPLUSPLUS _MSVC_LANG
64# define FMT_CPLUSPLUS __cplusplus
68# define FMT_HAS_FEATURE(x) __has_feature(x)
70# define FMT_HAS_FEATURE(x) 0
73#if defined(__has_include) || FMT_ICC_VERSION >= 1600 || FMT_MSC_VERSION > 1900
74# define FMT_HAS_INCLUDE(x) __has_include(x)
76# define FMT_HAS_INCLUDE(x) 0
79#ifdef __has_cpp_attribute
80# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
82# define FMT_HAS_CPP_ATTRIBUTE(x) 0
85#define FMT_HAS_CPP14_ATTRIBUTE(attribute) \
86 (FMT_CPLUSPLUS >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))
88#define FMT_HAS_CPP17_ATTRIBUTE(attribute) \
89 (FMT_CPLUSPLUS >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))
93#ifndef FMT_USE_CONSTEXPR
94# if (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VERSION >= 1912 || \
95 (FMT_GCC_VERSION >= 600 && FMT_CPLUSPLUS >= 201402L)) && \
96 !FMT_ICC_VERSION && (!defined(__NVCC__) || FMT_CPLUSPLUS >= 202002L)
97# define FMT_USE_CONSTEXPR 1
99# define FMT_USE_CONSTEXPR 0
103# define FMT_CONSTEXPR constexpr
105# define FMT_CONSTEXPR
108#if (FMT_CPLUSPLUS >= 202002L || \
109 (FMT_CPLUSPLUS >= 201709L && FMT_GCC_VERSION >= 1002)) && \
110 ((!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 10) && \
111 (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION >= 10000) && \
112 (!FMT_MSC_VERSION || FMT_MSC_VERSION >= 1928)) && \
113 defined(__cpp_lib_is_constant_evaluated)
114# define FMT_CONSTEXPR20 constexpr
116# define FMT_CONSTEXPR20
120#if defined(__GLIBCXX__)
121# if FMT_CPLUSPLUS >= 201703L && defined(_GLIBCXX_RELEASE) && \
122 _GLIBCXX_RELEASE >= 7
123# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
125#elif defined(_LIBCPP_VERSION) && FMT_CPLUSPLUS >= 201703L && \
126 _LIBCPP_VERSION >= 4000
127# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
128#elif FMT_MSC_VERSION >= 1914 && FMT_CPLUSPLUS >= 201703L
129# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
131#ifndef FMT_CONSTEXPR_CHAR_TRAITS
132# define FMT_CONSTEXPR_CHAR_TRAITS
136#ifndef FMT_EXCEPTIONS
137# if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \
138 (FMT_MSC_VERSION && !_HAS_EXCEPTIONS)
139# define FMT_EXCEPTIONS 0
141# define FMT_EXCEPTIONS 1
146#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VERSION && \
148# define FMT_NORETURN [[noreturn]]
154# if FMT_HAS_CPP17_ATTRIBUTE(nodiscard)
155# define FMT_NODISCARD [[nodiscard]]
157# define FMT_NODISCARD
162# if FMT_GCC_VERSION || FMT_CLANG_VERSION
163# define FMT_INLINE inline __attribute__((always_inline))
165# define FMT_INLINE inline
170# define FMT_UNCHECKED_ITERATOR(It) \
171 using _Unchecked_type = It
173# define FMT_UNCHECKED_ITERATOR(It) using unchecked_type = It
176#ifndef FMT_BEGIN_NAMESPACE
177# define FMT_BEGIN_NAMESPACE \
179 inline namespace v10 {
180# define FMT_END_NAMESPACE \
187# define FMT_BEGIN_EXPORT
188# define FMT_END_EXPORT
191#if FMT_GCC_VERSION || FMT_CLANG_VERSION
192# define FMT_VISIBILITY(value) __attribute__((visibility(value)))
194# define FMT_VISIBILITY(value)
197#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
198# if defined(FMT_LIB_EXPORT)
199# define FMT_API __declspec(dllexport)
200# elif defined(FMT_SHARED)
201# define FMT_API __declspec(dllimport)
203#elif defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
204# define FMT_API FMT_VISIBILITY("default")
211#if FMT_HAS_INCLUDE(<string_view>) && \
212 (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
213# include <string_view>
214# define FMT_USE_STRING_VIEW
215#elif FMT_HAS_INCLUDE("experimental/string_view") && FMT_CPLUSPLUS >= 201402L
216# include <experimental/string_view>
217# define FMT_USE_EXPERIMENTAL_STRING_VIEW
221# define FMT_UNICODE !FMT_MSC_VERSION
225# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
226 (!defined(__apple_build_version__) || \
227 __apple_build_version__ >= 14000029L) && \
228 FMT_CPLUSPLUS >= 202002L) || \
229 (defined(__cpp_consteval) && \
230 (!FMT_MSC_VERSION || FMT_MSC_VERSION >= 1929))
233# define FMT_CONSTEVAL consteval
234# define FMT_HAS_CONSTEVAL
236# define FMT_CONSTEVAL
240#ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS
241# if defined(__cpp_nontype_template_args) && \
242 ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \
243 __cpp_nontype_template_args >= 201911L) && \
244 !defined(__NVCOMPILER) && !defined(__LCC__)
245# define FMT_USE_NONTYPE_TEMPLATE_ARGS 1
247# define FMT_USE_NONTYPE_TEMPLATE_ARGS 0
252#ifndef FMT_DECLTYPE_THIS
253# if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
254# define FMT_DECLTYPE_THIS this->
256# define FMT_DECLTYPE_THIS
262#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) && !defined(__LCC__) && \
270template <
bool B,
typename T =
void>
272template <
bool B,
typename T,
typename F>
290template <
typename Char>
301# define FMT_ENABLE_IF(...)
303# define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0
309template <
typename T, FMT_ENABLE_IF(std::is_same<T, std::
byte>::value)>
311 return static_cast<unsigned char>(
b);
322 bool default_value =
false) noexcept ->
bool {
326#if FMT_CPLUSPLUS >= 202002L && defined(_GLIBCXX_RELEASE) && \
327 _GLIBCXX_RELEASE >= 12 && \
328 (FMT_CLANG_VERSION >= 1400 && FMT_CLANG_VERSION < 1500)
330 return __builtin_is_constant_evaluated();
331#elif defined(__cpp_lib_is_constant_evaluated)
335 return default_value;
345 const char* message);
350# define FMT_ASSERT(condition, message) \
351 fmt::detail::ignore_unused((condition), (message))
353# define FMT_ASSERT(condition, message) \
356 : fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
360#if defined(FMT_USE_STRING_VIEW)
361template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
362#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
363template <
typename Char>
364using std_string_view = std::experimental::basic_string_view<Char>;
371#elif defined(__SIZEOF_INT128__) && !defined(__NVCC__) && \
372 !(FMT_CLANG_VERSION && FMT_MSC_VERSION)
373# define FMT_USE_INT128 1
380# define FMT_USE_INT128 0
390template <
typename Int>
393 FMT_ASSERT(std::is_unsigned<Int>::value ||
value >= 0,
"negative value");
398 FMT_MSC_WARNING(suppress : 4566)
constexpr unsigned char section[] =
"\u00A7";
401 using uchar =
unsigned char;
402 return FMT_UNICODE || (
sizeof(section) == 3 && uchar(section[0]) == 0xC2 &&
403 uchar(section[1]) == 0xA7);
428 : data_(s), size_(
count) {}
442 ?
std::strlen(reinterpret_cast<const char*>(s))
443 :
std::char_traits<Char>::length(s)) {}
446 template <
typename Traits,
typename Alloc>
448 const std::basic_string<Char, Traits, Alloc>& s) noexcept
449 : data_(s.data()), size_(s.size()) {}
454 : data_(s.data()), size_(s.size()) {}
457 constexpr auto data() const noexcept -> const Char* {
return data_; }
460 constexpr auto size() const noexcept ->
size_t {
return size_; }
463 constexpr auto end() const noexcept ->
iterator {
return data_ + size_; }
465 constexpr auto operator[](
size_t pos)
const noexcept ->
const Char& {
476 return size_ >= sv.size_ &&
477 std::char_traits<Char>::compare(data_, sv.data_, sv.size_) == 0;
480 return size_ >= 1 && std::char_traits<Char>::eq(*data_,
c);
488 size_t str_size = size_ < other.size_ ? size_ : other.size_;
489 int result = std::char_traits<Char>::compare(data_, other.data_, str_size);
491 result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
498 return lhs.compare(rhs) == 0;
501 return lhs.compare(rhs) != 0;
504 return lhs.compare(rhs) < 0;
507 return lhs.compare(rhs) <= 0;
510 return lhs.compare(rhs) > 0;
513 return lhs.compare(rhs) >= 0;
522template <
typename T>
struct is_char : std::false_type {};
523template <>
struct is_char<char> : std::true_type {};
533template <
typename Char, FMT_ENABLE_IF(is_
char<Char>::value)>
537template <
typename Char,
typename Traits,
typename Alloc>
542template <
typename Char>
547template <
typename Char,
552template <
typename S, FMT_ENABLE_IF(is_compile_
string<S>::value)>
565 : std::is_class<decltype(detail::to_string_view(std::declval<S>()))> {};
570 using type =
typename result::value_type;
597template <
typename T,
typename Char>
600#define FMT_TYPE_CONSTANT(Type, constant) \
601 template <typename Char> \
602 struct type_constant<Type, Char> \
603 : std::integral_constant<type, type::constant> {}
627constexpr auto set(
type rhs) ->
int {
return 1 <<
static_cast<int>(rhs); }
629 return ((
set >>
static_cast<int>(t)) & 1) != 0;
687 : format_str_(format_str), next_arg_id_(
next_arg_id) {}
694 return format_str_.
begin();
712 if (next_arg_id_ < 0) {
714 "cannot switch from manual to automatic argument indexing");
717 int id = next_arg_id_++;
727 if (next_arg_id_ > 0) {
729 "cannot switch from automatic to manual argument indexing");
744template <
typename Char>
757 constexpr auto num_args() const ->
int {
return num_args_; }
782template <
typename Container>
785 using base = std::back_insert_iterator<Container>;
786 struct accessor : base {
787 accessor(base
b) : base(
b) {}
788 using base::container;
790 return *accessor(it).container;
793template <
typename Char,
typename InputIt,
typename OutputIt>
796 while (begin != end) *out++ =
static_cast<Char
>(*begin++);
800template <
typename Char,
typename T,
typename U,
806 if (size > 0) memcpy(out, begin, size *
sizeof(U));
828 : ptr_(p), size_(sz), capacity_(cap) {}
836 capacity_ = buf_capacity;
857 constexpr auto size() const noexcept ->
size_t {
return size_; }
860 constexpr auto capacity() const noexcept ->
size_t {
return capacity_; }
873 size_ =
count <= capacity_ ?
count : capacity_;
881 if (new_capacity > capacity_)
grow(new_capacity);
886 ptr_[size_++] =
value;
895 template <
typename Idx>
903 auto count() const ->
size_t {
return 0; }
904 auto limit(
size_t size) ->
size_t {
return size; }
914 auto count() const ->
size_t {
return count_; }
916 size_t n = limit_ > count_ ? limit_ - count_ : 0;
918 return size < n ? size : n;
923template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
927 enum { buffer_size = 256 };
928 T data_[buffer_size];
932 if (this->
size() == buffer_size)
flush();
938 out_ = copy_str<T>(data_, data_ + this->
limit(
size), out_);
943 : Traits(n),
buffer<T>(data_, 0, buffer_size), out_(
out) {}
945 : Traits(other),
buffer<T>(data_, 0, buffer_size), out_(other.out_) {}
961 enum { buffer_size = 256 };
962 T data_[buffer_size];
966 if (this->size() == this->capacity()) flush();
970 size_t n = this->limit(this->size());
971 if (this->data() == out_) {
973 this->
set(data_, buffer_size);
985 if (this->data() != out_) {
986 this->
set(data_, buffer_size);
1008 auto out() -> T* {
return &*this->end(); }
1012template <
typename Container>
1015 typename Container::value_type>>
1016 final :
public buffer<typename Container::value_type> {
1018 Container& container_;
1032 auto out() -> std::back_insert_iterator<Container> {
1033 return std::back_inserter(container_);
1040 enum { buffer_size = 256 };
1041 T data_[buffer_size];
1046 if (this->
size() != buffer_size)
return;
1047 count_ += this->
size();
1058template <
typename Char>
1065 if (
id >=
static_cast<context*
>(
this)->num_args())
1070template <
typename Char>
1076 static_cast<context*
>(
this)->check_dynamic_spec(arg_id);
1086template <
typename T,
typename Char =
char,
typename Enable =
void>
1094template <
typename T,
typename Context>
1096 std::is_constructible<typename Context::template formatter_type<T>>;
1100class appender :
public std::back_insert_iterator<detail::buffer<char>> {
1101 using base = std::back_insert_iterator<detail::buffer<char>>;
1114template <
typename Context,
typename T>
1116 ->
decltype(
typename Context::template formatter_type<T>().format(
1117 std::declval<const T&>(), std::declval<Context&>()),
1121template <
typename Context>
1125template <
typename T,
typename Context>
1127 return has_const_formatter_impl<Context>(
static_cast<T*
>(
nullptr));
1130template <
typename T>
1132 std::back_insert_iterator<buffer<T>>>;
1135template <
typename T,
typename OutputIt>
1139template <
typename T,
typename Buf,
1145template <
typename Buf,
typename OutputIt>
1149template <
typename T,
typename OutputIt>
1167template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1171 T
args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
1174 template <
typename... U>
1181template <
typename T,
typename Char,
size_t NUM_ARGS>
1186 template <
typename... U>
1194template <
typename Char>
1200template <
typename T,
typename Char>
1203template <
typename Char,
typename T,
typename... Tail,
1206 int named_arg_count,
const T&,
const Tail&... args) {
1210template <
typename Char,
typename T,
typename... Tail,
1213 int named_arg_count,
const T&
arg,
const Tail&... args) {
1214 named_args[named_arg_count++] = {
arg.name, arg_count};
1218template <
typename... Args>
1222template <
bool B = false>
constexpr auto count() ->
size_t {
return B ? 1 : 0; }
1223template <
bool B1,
bool B2,
bool... Tail>
constexpr auto count() ->
size_t {
1224 return (B1 ? 1 : 0) +
count<B2, Tail...>();
1228 return count<is_named_arg<Args>::value...>();
1231template <
typename... Args>
1233 return count<is_statically_named_arg<Args>::value...>();
1257template <
typename Context>
class value {
1297 string.data = val.
data();
1298 string.size = val.
size();
1306 custom.value =
const_cast<value_type*
>(std::addressof(val));
1310 custom.format = format_custom_arg<
1311 value_type,
typename Context::template formatter_type<value_type>>;
1319 template <
typename T,
typename Formatter>
1320 static void format_custom_arg(
void*
arg,
1321 typename Context::parse_context_type& parse_ctx,
1323 auto f = Formatter();
1324 parse_ctx.advance_to(f.parse(parse_ctx));
1325 using qualified_type =
1328 ctx.advance_to(f.format(*
static_cast<qualified_type*
>(
arg), ctx));
1339 template <
typename U,
1340 FMT_ENABLE_IF(std::is_enum<U>::value || std::is_class<U>::value)>
1344 using type =
decltype(
map(
static_cast<T*
>(
nullptr)));
1348template <
typename T>
1350 :
bool_constant<!std::is_same<format_as_t<T>, void>::value> {};
1374 ->
unsigned long long {
1385 template <
typename T, FMT_ENABLE_IF(std::is_same<T,
char>::value ||
1386 std::is_same<T,
char_type>::value)>
1390 template <
typename T, enable_if_t<(std::is_same<T,
wchar_t>::value ||
1392 std::is_same<T,
char8_t>::value ||
1394 std::is_same<T,
char16_t>::value ||
1395 std::is_same<T,
char32_t>::value) &&
1396 !std::is_same<T,
char_type>::value,
1414 template <
typename T,
1421 template <
typename T,
1441 std::is_pointer<T>::value || std::is_member_pointer<T>::value ||
1443 (std::is_array<T>::value &&
1444 !std::is_convertible<T, const char_type*>::value))>
1449 template <
typename T, std::size_t N,
1456 template <
typename T,
typename U = format_as_t<T>,
1457 FMT_ENABLE_IF(std::is_arithmetic<U>::value)>
1463 template <
typename T,
typename U = remove_const_t<T>>
1465 (has_formatter<U, Context>::value &&
1466 !std::is_const<T>::value)> {};
1468 template <
typename T, FMT_ENABLE_IF(formattable<T>::value)>
1472 template <
typename T, FMT_ENABLE_IF(!formattable<T>::value)>
1477 template <
typename T,
typename U = remove_const_t<T>,
1478 FMT_ENABLE_IF((std::is_
class<U>::value || std::is_enum<U>::value ||
1479 std::is_union<U>::value) &&
1480 !is_
string<U>::value && !is_
char<U>::value &&
1481 !is_named_arg<U>::value &&
1482 !std::is_arithmetic<format_as_t<U>>::value)>
1488 template <
typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
1498template <
typename T,
typename Context>
1501 typename Context::char_type>;
1509template <
typename Char,
typename InputIt>
1514template <
typename Char,
typename InputIt>
1516 std::back_insert_iterator<std::string> out)
1517 -> std::back_insert_iterator<std::string> {
1522template <
typename Char,
typename R,
typename OutputIt>
1524 return detail::copy_str<Char>(rng.begin(), rng.end(), out);
1527#if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
1529template <
typename...>
struct void_t_impl {
1532template <
typename... T>
using void_t =
typename void_t_impl<T...>
::type;
1537template <
typename It,
typename T,
typename Enable =
void>
1540template <
typename It,
typename T>
1544 decltype(*std::declval<It>() = std::declval<T>())>>
1545 : std::true_type {};
1548template <
typename Container>
1550 : std::true_type {};
1555 const void* locale_;
1559 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1561 explicit operator bool() const noexcept {
return locale_ !=
nullptr; }
1563 template <
typename Locale>
auto get() const -> Locale;
1570template <
typename Context,
typename Arg,
typename... Args>
1576#if defined(__cpp_if_constexpr)
1578template <
typename T,
typename Char>
struct type_is_unformattable_for;
1581template <
bool PACKED,
typename Context,
typename T, FMT_ENABLE_IF(PACKED)>
1585 constexpr bool formattable_char =
1586 !std::is_same<arg_type, unformattable_char>::value;
1587 static_assert(formattable_char,
"Mixing character types is disallowed.");
1592 constexpr bool formattable_pointer =
1593 !std::is_same<arg_type, unformattable_pointer>::value;
1594 static_assert(formattable_pointer,
1595 "Formatting of non-void pointers is disallowed.");
1597 constexpr bool formattable = !std::is_same<arg_type, unformattable>::value;
1598#if defined(__cpp_if_constexpr)
1599 if constexpr (!formattable) {
1600 type_is_unformattable_for<T, typename Context::char_type> _;
1605 "Cannot format an argument. To make type T formattable provide a "
1606 "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
1610template <
typename Context,
typename T>
1614 arg.value_ = make_arg<true, Context>(val);
1618template <
bool PACKED,
typename Context,
typename T, FMT_ENABLE_IF(!PACKED)>
1620 return make_arg<Context>(val);
1632 template <
typename ContextType,
typename T>
1636 template <
typename Visitor,
typename Ctx>
1639 ->
decltype(vis(0));
1644 using char_type =
typename Context::char_type;
1646 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1650 : value_(
args, size) {}
1657 void format(
typename Context::parse_context_type& parse_ctx,
1658 Context& ctx)
const {
1659 custom_.format(custom_.value, parse_ctx, ctx);
1668 constexpr explicit operator bool() const noexcept {
1680 typename Context::parse_context_type& parse_ctx,
1681 Context& ctx) ->
bool {
1683 parse_ctx.advance_to(parse_begin);
1684 value_.
custom.format(value_.
custom.value, parse_ctx, ctx);
1697template <
typename Visitor,
typename Context>
1700 switch (
arg.type_) {
1704 return vis(
arg.value_.int_value);
1706 return vis(
arg.value_.uint_value);
1708 return vis(
arg.value_.long_long_value);
1710 return vis(
arg.value_.ulong_long_value);
1716 return vis(
arg.value_.bool_value);
1718 return vis(
arg.value_.char_value);
1720 return vis(
arg.value_.float_value);
1722 return vis(
arg.value_.double_value);
1724 return vis(
arg.value_.long_double_value);
1726 return vis(
arg.value_.string.data);
1729 return vis(sv(
arg.value_.string.data,
arg.value_.string.size));
1731 return vis(
arg.value_.pointer);
1764 : out_(out), args_(ctx_args), loc_(loc) {}
1768 return args_.
get(name);
1771 return args_.
get_id(name);
1777 void on_error(
const char* message) { error_handler().on_error(message); }
1790template <
typename Char>
1795template <
typename T,
typename Char =
char>
1798 .
map(std::declval<T&>()))>::value>;
1807template <
typename Context,
typename... Args>
1815 static const size_t num_args =
sizeof...(Args);
1828 static constexpr unsigned long long desc =
1831 (num_named_args != 0
1836 template <
typename... T>
1874template <
typename Char,
typename T>
1901 unsigned long long desc_;
1912 constexpr auto is_packed() const ->
bool {
1915 auto has_named_args() const ->
bool {
1922 return static_cast<detail::type>((desc_ >> shift) & mask);
1927 : desc_(desc), values_(values) {}
1929 : desc_(desc), args_(args) {}
1939 template <
typename... Args>
1943 store.data_.args()) {}
1968 if (
id < max_size())
arg = args_[id];
1974 arg.value_ = values_[id];
1978 template <
typename Char>
1980 int id = get_id(name);
1984 template <
typename Char>
1986 if (!has_named_args())
return -1;
1987 const auto& named_args =
1988 (is_packed() ? values_[-1] : args_[-1].value_).named_args;
1989 for (
size_t i = 0; i < named_args.size; ++i) {
1990 if (named_args.data[i].name == name)
return named_args.data[i].id;
1997 return static_cast<int>(is_packed() ? max_packed
2011#if FMT_GCC_VERSION && FMT_GCC_VERSION < 903
2012# define FMT_ENUM_UNDERLYING_TYPE(type)
2014# define FMT_ENUM_UNDERLYING_TYPE(type) : type
2031 enum { max_size = 4 };
2032 Char data_[max_size] = {Char(
' '), Char(0), Char(0), Char(0)};
2033 unsigned char size_ = 1;
2039 for (
size_t i = 0; i <
size; ++i) data_[i] = s[i];
2040 size_ =
static_cast<unsigned char>(
size);
2043 constexpr auto size() const ->
size_t {
return size_; }
2044 constexpr auto data() const -> const Char* {
return data_; }
2048 return data_[
index];
2128template <
typename Char =
char>
2135template <
typename Char, FMT_ENABLE_IF(std::is_
integral<Char>::value)>
2137 return c <= 0xff ? static_cast<char>(
c) :
'\0';
2139template <
typename Char, FMT_ENABLE_IF(std::is_enum<Char>::value)>
2140constexpr auto to_ascii(Char
c) ->
char {
2141 return c <= 0xff ? static_cast<char>(
c) :
'\0';
2145template <
typename Char>
2148 auto c =
static_cast<unsigned char>(*begin);
2149 return static_cast<int>((0x3a55000000000000ull >> (2 * (
c >> 3))) & 0x3) + 1;
2153template <
bool IS_CONSTEXPR,
typename T,
typename Ptr = const T*>
2155 for (out =
first; out != last; ++out) {
2156 if (*out ==
value)
return true;
2163 const char*& out) ->
bool {
2164 out =
static_cast<const char*
>(
2166 return out !=
nullptr;
2171template <
typename Char>
2173 int error_value)
noexcept ->
int {
2174 FMT_ASSERT(begin != end &&
'0' <= *begin && *begin <=
'9',
"");
2175 unsigned value = 0, prev = 0;
2181 }
while (p != end &&
'0' <= *p && *p <=
'9');
2182 auto num_digits = p - begin;
2185 return static_cast<int>(
value);
2189 prev * 10ull + unsigned(p[-1] -
'0') <=
max
2190 ?
static_cast<int>(
value)
2199 return align::right;
2201 return align::center;
2207 return (
'a' <=
c &&
c <=
'z') || (
'A' <=
c &&
c <=
'Z') ||
c ==
'_';
2210template <
typename Char,
typename Handler>
2212 Handler&& handler) ->
const Char* {
2214 if (
c >=
'0' &&
c <=
'9') {
2221 if (begin == end || (*begin !=
'}' && *begin !=
':'))
2224 handler.on_index(
index);
2234 }
while (it != end && (
is_name_start(*it) || (
'0' <= *it && *it <=
'9')));
2235 handler.on_name({begin,
to_unsigned(it - begin)});
2239template <
typename Char,
typename Handler>
2241 Handler&& handler) ->
const Char* {
2254 int id =
ctx.next_arg_id();
2256 ctx.check_dynamic_spec(
id);
2260 ctx.check_arg_id(
id);
2261 ctx.check_dynamic_spec(
id);
2265 ctx.check_arg_id(
id);
2270template <
typename Char>
2276 if (
'0' <= *begin && *begin <=
'9') {
2282 }
else if (*begin ==
'{') {
2285 if (begin != end) begin =
parse_arg_id(begin, end, handler);
2286 if (begin != end && *begin ==
'}')
return ++begin;
2292template <
typename Char>
2298 if (begin == end || *begin ==
'}') {
2308template <
typename Char>
2313 if (end - begin > 1) {
2317 if (begin == end)
return begin;
2324 if (current_state >= s || !valid)
2338 if (!
in(arg_type,
set)) {
2342 specs.
type = pres_type;
2345 } parse_presentation_type{begin, specs, arg_type};
2363 specs.sign = sign::plus;
2366 specs.sign = sign::minus;
2369 specs.sign = sign::space;
2386 if (specs.align == align::none) {
2388 specs.align = align::numeric;
2389 specs.fill[0] = Char(
'0');
2410 begin =
parse_precision(begin, end, specs.precision, specs.precision_ref,
2416 specs.localized =
true;
2420 return parse_presentation_type(pres::dec, integral_set);
2422 return parse_presentation_type(pres::oct, integral_set);
2424 return parse_presentation_type(pres::hex_lower, integral_set);
2426 return parse_presentation_type(pres::hex_upper, integral_set);
2428 return parse_presentation_type(pres::bin_lower, integral_set);
2430 return parse_presentation_type(pres::bin_upper, integral_set);
2432 return parse_presentation_type(pres::hexfloat_lower,
float_set);
2434 return parse_presentation_type(pres::hexfloat_upper,
float_set);
2436 return parse_presentation_type(pres::exp_lower,
float_set);
2438 return parse_presentation_type(pres::exp_upper,
float_set);
2440 return parse_presentation_type(pres::fixed_lower,
float_set);
2442 return parse_presentation_type(pres::fixed_upper,
float_set);
2444 return parse_presentation_type(pres::general_lower,
float_set);
2446 return parse_presentation_type(pres::general_upper,
float_set);
2450 return parse_presentation_type(pres::chr, integral_set);
2452 return parse_presentation_type(pres::string,
2457 return parse_presentation_type(pres::debug,
2462 if (*begin ==
'}')
return begin;
2465 if (end - fill_end <= 0) {
2469 if (*begin ==
'{') {
2475 specs.fill = {begin,
to_unsigned(fill_end - begin)};
2476 specs.align =
align;
2477 begin = fill_end + 1;
2480 if (begin == end)
return begin;
2485template <
typename Char,
typename Handler>
2487 Handler&& handler) ->
const Char* {
2492 FMT_CONSTEXPR void on_auto() { arg_id = handler.on_arg_id(); }
2493 FMT_CONSTEXPR void on_index(
int id) { arg_id = handler.on_arg_id(
id); }
2495 arg_id = handler.on_arg_id(
id);
2500 if (begin == end)
return handler.on_error(
"invalid format string"), end;
2501 if (*begin ==
'}') {
2502 handler.on_replacement_field(handler.on_arg_id(), begin);
2503 }
else if (*begin ==
'{') {
2504 handler.on_text(begin, begin + 1);
2506 auto adapter = id_adapter{handler, 0};
2508 Char
c = begin != end ? *begin : Char();
2510 handler.on_replacement_field(adapter.arg_id, begin);
2511 }
else if (
c ==
':') {
2512 begin = handler.on_format_specs(adapter.arg_id, begin + 1, end);
2513 if (begin == end || *begin !=
'}')
2514 return handler.on_error(
"unknown format specifier"), end;
2516 return handler.on_error(
"missing '}' in format string"), end;
2522template <
bool IS_CONSTEXPR,
typename Char,
typename Handler>
2525 auto begin = format_str.
data();
2526 auto end = begin + format_str.
size();
2527 if (end - begin < 32) {
2529 const Char* p = begin;
2533 handler.on_text(begin, p - 1);
2535 }
else if (
c ==
'}') {
2536 if (p == end || *p !=
'}')
2537 return handler.on_error(
"unmatched '}' in format string");
2538 handler.on_text(begin, p);
2542 handler.on_text(begin, end);
2547 if (
from == to)
return;
2549 const Char* p =
nullptr;
2550 if (!find<IS_CONSTEXPR>(
from, to, Char(
'}'), p))
2551 return handler_.on_text(
from, to);
2553 if (p == to || *p !=
'}')
2554 return handler_.
on_error(
"unmatched '}' in format string");
2555 handler_.on_text(
from, p);
2560 }
write = {handler};
2561 while (begin != end) {
2564 const Char* p = begin;
2565 if (*begin !=
'{' && !find<IS_CONSTEXPR>(begin + 1, end, Char(
'{'), p))
2566 return write(begin, end);
2579template <
typename T,
typename ParseContext>
2581 ->
decltype(ctx.begin()) {
2582 using char_type =
typename ParseContext::char_type;
2588#if defined(__cpp_if_constexpr)
2589 if constexpr (std::is_default_constructible<
2593 type_is_unformattable_for<T, char_type> _;
2602template <
typename Char>
2609 if (specs.align == align::numeric || specs.sign != sign::none || specs.alt)
2614#if FMT_USE_NONTYPE_TEMPLATE_ARGS
2615template <
int N,
typename T,
typename... Args,
typename Char>
2617 if constexpr (is_statically_named_arg<T>()) {
2618 if (name ==
T::name)
return N;
2620 if constexpr (
sizeof...(Args) > 0)
2627template <
typename... Args,
typename Char>
2629#if FMT_USE_NONTYPE_TEMPLATE_ARGS
2630 if constexpr (
sizeof...(Args) > 0)
2640 static constexpr int num_args =
sizeof...(Args);
2648 type types_[num_args > 0 ?
static_cast<size_t>(num_args) : 1];
2650 parse_func parse_funcs_[num_args > 0 ?
static_cast<size_t>(num_args) : 1];
2655 context_(fmt, num_args, types_),
2662 return context_.check_arg_id(
id), id;
2665#if FMT_USE_NONTYPE_TEMPLATE_ARGS
2671 on_error(
"compile-time checks for named arguments require C++20 support");
2684 return id >= 0 &&
id < num_args ? parse_funcs_[id](context_) : begin;
2693template <
typename...,
typename S,
FMT_ENABLE_IF(!is_compile_string<S>::value)>
2695#ifdef FMT_ENFORCE_COMPILE_STRING
2697 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use "
2701template <
typename... Args,
typename S,
2704 using char_t =
typename S::char_type;
2720template <
typename Char>
2733template <
typename T,
typename Char>
2741 template <
typename ParseContext>
2750 template <detail::type U = detail::type_constant<T, Char>::value,
2758 template <
typename FormatContext>
2760 ->
decltype(ctx.out());
2773 template <
typename S,
2779 (std::is_base_of<detail::view, remove_reference_t<Args>>::value &&
2780 std::is_reference<Args>::value)...>() == 0,
2781 "passing views as lvalues is disallowed");
2782#ifdef FMT_HAS_CONSTEVAL
2784 detail::count_statically_named_args<Args...>()) {
2787 detail::parse_format_string<true>(str_, checker(s));
2799#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
2804template <
typename... Args>
2832template <
typename... T>
2839template <
typename OutputIt,
2842 auto&& buf = detail::get_buffer<char>(out);
2859template <
typename OutputIt,
typename... T,
2873template <
typename OutputIt,
typename... T,
2880 return {buf.out(), buf.count()};
2891template <
typename OutputIt,
typename... T,
2899template <
typename... T>
2901 T&&... args) ->
size_t {
2920template <
typename... T>
2937template <
typename... T>
2948template <
typename... T>
2957template <
typename... T>
2959 return fmt::println(stdout, fmt, std::forward<T>(args)...);
2966#ifdef FMT_HEADER_ONLY
you may not use this file except in compliance with the License You may obtain a copy of the License at software distributed under the License is distributed on an AS IS WITHOUT WARRANTIES OR CONDITIONS OF ANY either express or implied See the License for the specific language governing permissions and limitations under the License LLVM Exceptions to the Apache License As an if
Definition: ThirdPartyNotices.txt:290
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:193
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable from
Definition: ThirdPartyNotices.txt:129
appender(base it) noexcept
Definition: core.h:1105
auto operator++() noexcept -> appender &
Definition: core.h:1108
auto operator++(int) noexcept -> appender
Definition: core.h:1109
FMT_UNCHECKED_ITERATOR(appender)
basic_format_context(const basic_format_context &)=delete
OutputIt iterator
Definition: core.h:1746
FMT_CONSTEXPR auto locale() -> detail::locale_ref
Definition: core.h:1787
auto args() const -> const format_args &
Definition: core.h:1773
FMT_CONSTEXPR auto out() -> iterator
Definition: core.h:1780
Char char_type
The character type for the output.
Definition: core.h:1753
void on_error(const char *message)
Definition: core.h:1777
FMT_CONSTEXPR auto error_handler() -> detail::error_handler
Definition: core.h:1776
constexpr auto arg(int id) const -> format_arg
Definition: core.h:1766
void advance_to(iterator it)
Definition: core.h:1783
basic_format_context(basic_format_context &&)=default
FMT_CONSTEXPR auto arg(basic_string_view< Char > name) -> format_arg
Definition: core.h:1767
FMT_CONSTEXPR auto arg_id(basic_string_view< Char > name) -> int
Definition: core.h:1770
constexpr basic_format_context(OutputIt out, format_args ctx_args, detail::locale_ref loc={})
Constructs a basic_format_context object.
Definition: core.h:1762
void operator=(const basic_format_context &)=delete
\rst Parsing context consisting of a format string range being parsed and an argument counter for aut...
Definition: core.h:674
FMT_CONSTEXPR auto next_arg_id() -> int
Reports an error if using the manual argument indexing; otherwise returns the next argument index and...
Definition: core.h:711
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
Definition: core.h:1071
const Char * iterator
Definition: core.h:683
constexpr auto end() const noexcept -> iterator
Returns an iterator past the end of the format string range being parsed.
Definition: core.h:700
Char char_type
Definition: core.h:682
constexpr basic_format_parse_context(basic_string_view< Char > format_str, int next_arg_id=0)
Definition: core.h:685
FMT_CONSTEXPR void check_arg_id(int id)
Reports an error if using the automatic argument indexing; otherwise switches to the manual indexing.
Definition: core.h:726
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
Definition: core.h:735
FMT_CONSTEXPR void advance_to(iterator it)
Advances the begin iterator to it.
Definition: core.h:703
constexpr auto begin() const noexcept -> iterator
Returns an iterator to the beginning of the format string range being parsed.
Definition: core.h:693
An implementation of std::basic_string_view for pre-C++17.
Definition: core.h:415
FMT_CONSTEXPR basic_string_view(const std::basic_string< Char, Traits, Alloc > &s) noexcept
Constructs a string reference from a std::basic_string object.
Definition: core.h:447
constexpr auto end() const noexcept -> iterator
Definition: core.h:463
const Char * iterator
Definition: core.h:422
constexpr auto size() const noexcept -> size_t
Returns the string size.
Definition: core.h:460
FMT_CONSTEXPR_CHAR_TRAITS auto starts_with(const Char *s) const -> bool
Definition: core.h:482
FMT_CONSTEXPR_CHAR_TRAITS auto starts_with(Char c) const noexcept -> bool
Definition: core.h:479
constexpr auto data() const noexcept -> const Char *
Returns a pointer to the string data.
Definition: core.h:457
FMT_CONSTEXPR_CHAR_TRAITS friend auto operator==(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:495
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:509
constexpr auto begin() const noexcept -> iterator
Definition: core.h:462
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:503
Char value_type
Definition: core.h:421
FMT_CONSTEXPR basic_string_view(S s) noexcept
Definition: core.h:453
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:506
FMT_CONSTEXPR void remove_prefix(size_t n) noexcept
Definition: core.h:469
FMT_CONSTEXPR_CHAR_TRAITS FMT_INLINE basic_string_view(const Char *s)
\rst Constructs a string reference object from a C string computing the size with std::char_traits<Ch...
Definition: core.h:438
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:500
constexpr auto operator[](size_t pos) const noexcept -> const Char &
Definition: core.h:465
constexpr basic_string_view(const Char *s, size_t count) noexcept
Constructs a string reference object from a C string and a size.
Definition: core.h:427
FMT_CONSTEXPR_CHAR_TRAITS auto starts_with(basic_string_view< Char > sv) const noexcept -> bool
Definition: core.h:474
constexpr basic_string_view() noexcept
Definition: core.h:424
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:512
FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int
Definition: core.h:487
\rst A contiguous memory buffer with an optional growing ability.
Definition: core.h:816
FMT_CONSTEXPR20 void push_back(const T &value)
Definition: core.h:884
FMT_INLINE auto end() noexcept -> T *
Definition: core.h:851
FMT_CONSTEXPR20 buffer(T *p=nullptr, size_t sz=0, size_t cap=0) noexcept
Definition: core.h:827
FMT_CONSTEXPR20 void try_reserve(size_t new_capacity)
Definition: core.h:880
FMT_CONSTEXPR20 void try_resize(size_t count)
Definition: core.h:871
T value_type
Definition: core.h:844
FMT_CONSTEXPR void set(T *buf_data, size_t buf_capacity) noexcept
Sets the buffer data and capacity.
Definition: core.h:834
FMT_CONSTEXPR auto operator[](Idx index) const -> const T &
Definition: core.h:896
FMT_INLINE auto begin() const noexcept -> const T *
Definition: core.h:853
void clear()
Clears this buffer.
Definition: core.h:867
constexpr auto size() const noexcept -> size_t
Returns the size of this buffer.
Definition: core.h:857
FMT_CONSTEXPR auto data() const noexcept -> const T *
Definition: core.h:864
buffer(const buffer &)=delete
void append(const U *begin, const U *end)
Appends data to the end of the buffer.
constexpr auto capacity() const noexcept -> size_t
Returns the capacity of this buffer.
Definition: core.h:860
FMT_CONSTEXPR20 ~buffer()=default
const T & const_reference
Definition: core.h:845
virtual FMT_CONSTEXPR20 void grow(size_t capacity)=0
Increases the buffer capacity to hold at least capacity elements.
FMT_CONSTEXPR auto operator[](Idx index) -> T &
Definition: core.h:892
void operator=(const buffer &)=delete
FMT_CONSTEXPR auto data() noexcept -> T *
Returns a pointer to the buffer data (not null-terminated).
Definition: core.h:863
buffer(buffer &&)=default
FMT_INLINE auto begin() noexcept -> T *
Definition: core.h:850
FMT_INLINE auto end() const noexcept -> const T *
Definition: core.h:854
FMT_CONSTEXPR compile_parse_context(basic_string_view< Char > format_str, int num_args, const type *types, int next_arg_id=0)
Definition: core.h:752
constexpr auto num_args() const -> int
Definition: core.h:757
FMT_CONSTEXPR auto next_arg_id() -> int
Definition: core.h:760
FMT_CONSTEXPR void check_arg_id(int id)
Definition: core.h:766
constexpr auto arg_type(int id) const -> type
Definition: core.h:758
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
Definition: core.h:772
counting_buffer()
Definition: core.h:1052
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:1045
auto count() -> size_t
Definition: core.h:1054
auto count() const -> size_t
Definition: core.h:914
auto limit(size_t size) -> size_t
Definition: core.h:915
fixed_buffer_traits(size_t limit)
Definition: core.h:913
~iterator_buffer()
Definition: core.h:990
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:965
auto count() const -> size_t
Definition: core.h:996
iterator_buffer(iterator_buffer &&other)
Definition: core.h:981
iterator_buffer(T *out, size_t n=buffer_size)
Definition: core.h:979
auto out() -> T *
Definition: core.h:992
void flush()
Definition: core.h:969
auto out() -> T *
Definition: core.h:1008
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:1003
iterator_buffer(T *out, size_t=0)
Definition: core.h:1006
FMT_CONSTEXPR20 void grow(size_t capacity) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:1021
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
Definition: core.h:1029
auto out() -> std::back_insert_iterator< Container >
Definition: core.h:1032
iterator_buffer(Container &c)
Definition: core.h:1027
void flush()
Definition: core.h:935
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:931
iterator_buffer(iterator_buffer &&other)
Definition: core.h:944
iterator_buffer(OutputIt out, size_t n=buffer_size)
Definition: core.h:942
auto count() const -> size_t
Definition: core.h:952
~iterator_buffer()
Definition: core.h:946
auto out() -> OutputIt
Definition: core.h:948
constexpr FMT_INLINE locale_ref()
Definition: core.h:1558
auto get() const -> Locale
Definition: format-inl.h:88
value(unformattable_char)
FMT_CONSTEXPR FMT_INLINE value(const char_type *val)
Definition: core.h:1292
int int_value
Definition: core.h:1263
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
Definition: core.h:1301
FMT_CONSTEXPR20 FMT_INLINE value(T &val)
Definition: core.h:1304
uint128_opt uint128_value
Definition: core.h:1268
constexpr FMT_INLINE value(long long val)
Definition: core.h:1283
bool bool_value
Definition: core.h:1269
FMT_INLINE value(uint128_opt val)
Definition: core.h:1286
unsigned long long ulong_long_value
Definition: core.h:1266
double double_value
Definition: core.h:1272
long double long_double_value
Definition: core.h:1273
constexpr FMT_INLINE value(unsigned val)
Definition: core.h:1282
constexpr FMT_INLINE value(float val)
Definition: core.h:1287
constexpr FMT_INLINE value(unsigned long long val)
Definition: core.h:1284
FMT_INLINE value(long double val)
Definition: core.h:1289
float float_value
Definition: core.h:1271
value(unformattable_pointer)
constexpr FMT_INLINE value()
Definition: core.h:1280
int128_opt int128_value
Definition: core.h:1267
constexpr FMT_INLINE value(double val)
Definition: core.h:1288
custom_value< Context > custom
Definition: core.h:1276
FMT_INLINE value(const void *val)
Definition: core.h:1300
named_arg_value< char_type > named_args
Definition: core.h:1277
constexpr FMT_INLINE value(int val)
Definition: core.h:1281
FMT_INLINE value(int128_opt val)
Definition: core.h:1285
char_type char_value
Definition: core.h:1270
string_value< char_type > string
Definition: core.h:1275
typename Context::char_type char_type
Definition: core.h:1259
monostate no_value
Definition: core.h:1262
constexpr FMT_INLINE value(char_type val)
Definition: core.h:1291
const void * pointer
Definition: core.h:1274
unsigned uint_value
Definition: core.h:1264
FMT_CONSTEXPR FMT_INLINE value(basic_string_view< char_type > val)
Definition: core.h:1296
constexpr FMT_INLINE value(bool val)
Definition: core.h:1290
long long long_long_value
Definition: core.h:1265
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:271
#define FMT_ASSERT(condition, message)
Definition: core.h:353
FMT_NODISCARD FMT_INLINE auto format(format_string< T... > fmt, T &&... args) -> std::string
\rst Formats args according to specifications in fmt and returns the result as a string.
Definition: core.h:2833
FMT_CONSTEXPR FMT_INLINE auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
\rst Visits an argument dispatching to the appropriate visit method based on the argument type.
Definition: core.h:1698
#define FMT_END_EXPORT
Definition: core.h:188
#define FMT_ENUM_UNDERLYING_TYPE(type)
Definition: core.h:2014
std::integral_constant< bool, B > bool_constant
Definition: core.h:274
FMT_NODISCARD FMT_INLINE auto formatted_size(format_string< T... > fmt, T &&... args) -> size_t
Returns the number of chars in the output of format(fmt, args...).
Definition: core.h:2900
#define FMT_CONSTEVAL
Definition: core.h:236
basic_string_view< char > string_view
Definition: core.h:518
#define FMT_UNICODE
Definition: core.h:221
align::type align_t
Definition: core.h:2020
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
\rst Returns a named argument to be used in a formatting function.
Definition: core.h:1875
typename std::remove_const< T >::type remove_const_t
Definition: core.h:278
#define FMT_NODISCARD
Definition: core.h:157
typename std::remove_reference< T >::type remove_reference_t
Definition: core.h:276
typename detail::char_t_impl< S >::type char_t
String's character type.
Definition: core.h:664
buffer_context< char > format_context
Definition: core.h:1793
FMT_API void vprint(string_view fmt, format_args args)
Definition: format-inl.h:1481
auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
Definition: core.h:2875
#define FMT_GCC_VERSION
Definition: core.h:33
FMT_INLINE void print(format_string< T... > fmt, T &&... args)
\rst Formats args according to specifications in fmt and writes the output to stdout.
Definition: core.h:2921
#define FMT_GCC_PRAGMA(arg)
Definition: core.h:41
#define FMT_CONSTEXPR
Definition: core.h:105
std::is_constructible< typename Context::template formatter_type< T > > has_formatter
Definition: core.h:1096
#define FMT_DECLTYPE_THIS
Definition: core.h:256
#define FMT_BEGIN_NAMESPACE
Definition: core.h:177
auto runtime(string_view s) -> runtime_format_string<>
\rst Creates a runtime format string.
Definition: core.h:2816
#define FMT_API
Definition: core.h:207
constexpr auto make_format_args(T &... args) -> format_arg_store< Context, remove_cvref_t< T >... >
\rst Constructs a ~fmtformat_arg_store object that contains references to arguments and can be implic...
Definition: core.h:1858
#define FMT_ENABLE_IF(...)
Definition: core.h:303
#define FMT_BEGIN_EXPORT
Definition: core.h:187
FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string< T... > fmt, T &&... args) -> format_to_n_result< OutputIt >
\rst Formats args according to specifications in fmt, writes up to n characters of the result to the ...
Definition: core.h:2893
#define FMT_CONSTEXPR_CHAR_TRAITS
Definition: core.h:132
#define FMT_INLINE
Definition: core.h:165
FMT_INLINE void println(std::FILE *f, format_string< T... > fmt, T &&... args)
Formats args according to specifications in fmt and writes the output to the file f followed by a new...
Definition: core.h:2949
basic_format_args< format_context > format_args
An alias to basic_format_args<format_context>.
Definition: core.h:2005
#define FMT_NORETURN
Definition: core.h:150
#define FMT_MSC_WARNING(...)
Definition: core.h:58
typename type_identity< T >::type type_identity_t
Definition: core.h:284
FMT_INLINE auto format_to(OutputIt out, format_string< T... > fmt, T &&... args) -> OutputIt
\rst Formats args according to specifications in fmt, writes the result to the output iterator out an...
Definition: core.h:2861
typename std::conditional< B, T, F >::type conditional_t
Definition: core.h:273
#define FMT_CONSTEXPR20
Definition: core.h:116
sign::type sign_t
Definition: core.h:2024
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
Definition: core.h:280
typename std::underlying_type< T >::type underlying_t
Definition: core.h:286
presentation_type
Definition: core.h:2053
#define FMT_END_NAMESPACE
Definition: core.h:180
bool_constant<!std::is_base_of< detail::unformattable, decltype(detail::arg_mapper< buffer_context< Char > >() .map(std::declval< T & >()))>::value > is_formattable
Definition: core.h:1798
#define FMT_EXPORT
Definition: core.h:186
detail namespace with internal helper functions
Definition: ostream.h:24
auto first(const T &value, const Tail &...) -> const T &
Definition: compile.h:60
FMT_CONSTEXPR auto code_point_length(const Char *begin) -> int
Definition: core.h:2146
constexpr auto to_ascii(Char c) -> char
Definition: core.h:2136
void void_t
Definition: core.h:1534
FMT_CONSTEXPR auto check_char_specs(const format_specs< Char > &specs) -> bool
Definition: core.h:2603
FMT_CONSTEXPR void ignore_unused(const T &...)
Definition: core.h:319
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
Definition: core.h:1136
uint128_opt
Definition: core.h:384
constexpr auto is_integral_type(type t) -> bool
Definition: core.h:620
conditional_t< long_short, unsigned, unsigned long long > ulong_type
Definition: core.h:1336
FMT_CONSTEXPR auto parse_nonnegative_int(const Char *&begin, const Char *end, int error_value) noexcept -> int
Definition: core.h:2172
FMT_TYPE_CONSTANT(int, int_type)
FMT_CONSTEXPR auto parse_dynamic_spec(const Char *begin, const Char *end, int &value, arg_ref< Char > &ref, basic_format_parse_context< Char > &ctx) -> const Char *
Definition: core.h:2271
constexpr auto digits10() noexcept -> int
Definition: format.h:1248
void init_named_args(named_arg_info< Char > *, int, int)
Definition: core.h:1195
FMT_CONSTEXPR auto copy_str(InputIt begin, InputIt end, counting_iterator it) -> counting_iterator
Definition: compile.h:17
FMT_CONSTEXPR auto parse_replacement_field(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2486
FMT_INLINE auto to_string_view(const Char *s) -> basic_string_view< Char >
Definition: core.h:534
@ is_unpacked_bit
Definition: core.h:1506
int128_opt
Definition: core.h:383
constexpr auto sign(Sign s) -> Char
Definition: format.h:1137
FMT_CONSTEXPR auto do_parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2211
auto convert_for_visit(T) -> monostate
Definition: core.h:386
FMT_FUNC void print(std::FILE *f, string_view text)
Definition: format-inl.h:1463
constexpr auto is_name_start(Char c) -> bool
Definition: core.h:2206
FMT_FUNC void throw_format_error(const char *message)
Definition: format-inl.h:39
constexpr auto has_const_formatter_impl(T *) -> decltype(typename Context::template formatter_type< T >().format(std::declval< const T & >(), std::declval< Context & >()), true)
Definition: core.h:1115
constexpr auto in(type t, int set) -> bool
Definition: core.h:628
void vformat_to(buffer< Char > &buf, basic_string_view< Char > fmt, typename vformat_args< Char >::type args, locale_ref loc)
Definition: format.h:4361
FMT_CONSTEXPR FMT_INLINE void parse_format_string(basic_string_view< Char > format_str, Handler &&handler)
Definition: core.h:2523
typename std::enable_if< B, T >::type enable_if_t
Definition: cpp_future.h:38
auto vformat(const Locale &loc, basic_string_view< Char > fmt, basic_format_args< buffer_context< type_identity_t< Char > > > args) -> std::basic_string< Char >
Definition: format.h:3910
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2154
@ has_named_args_bit
Definition: core.h:1507
FMT_CONSTEXPR auto is_utf8() -> bool
Definition: core.h:397
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
Definition: core.h:2726
@ error
throw a parse_error exception in case of a tag
typename format_as_result< T >::type format_as_t
Definition: core.h:1346
FMT_CONSTEXPR FMT_INLINE auto make_arg(T &val) -> value< Context >
Definition: core.h:1582
constexpr auto is_arithmetic_type(type t) -> bool
Definition: core.h:623
auto get(const wpi::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
Definition: iteration_proxy.h:193
std::integral_constant< bool, Value > bool_constant
Definition: type_traits.h:688
constexpr auto count_named_args() -> size_t
Definition: core.h:1227
auto get_container(std::back_insert_iterator< Container > it) -> Container &
Definition: core.h:783
constexpr auto has_const_formatter() -> bool
Definition: core.h:1126
@ max_packed_args
Definition: core.h:1505
constexpr auto count() -> size_t
Definition: core.h:1222
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T > > > buffer_appender
Definition: core.h:1132
std::size_t hash(const BasicJsonType &j)
hash a JSON value
Definition: hash.h:41
FMT_INLINE void check_format_string(const S &)
Definition: core.h:2694
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2240
FMT_INLINE auto get_iterator(Buf &buf, OutputIt) -> decltype(buf.out())
Definition: core.h:1146
constexpr auto count_statically_named_args() -> size_t
Definition: core.h:1232
constexpr auto set(type rhs) -> int
Definition: core.h:627
FMT_CONSTEXPR auto write(OutputIt out, Char value, const format_specs< Char > &specs, locale_ref loc={}) -> OutputIt
Definition: format.h:1955
@ packed_arg_bits
Definition: core.h:1503
arg_id_kind
Definition: core.h:2098
state
Definition: core.h:2305
constexpr auto count() -> size_t
Definition: core.h:1223
type
Definition: core.h:573
constexpr FMT_INLINE auto const_check(T value) -> T
Definition: core.h:340
conditional_t< long_short, int, long long > long_type
Definition: core.h:1335
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view< Char > name) -> int
Definition: core.h:2628
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
Definition: core.h:391
FMT_CONSTEXPR FMT_INLINE auto parse_format_specs(const Char *begin, const Char *end, dynamic_format_specs< Char > &specs, basic_format_parse_context< Char > &ctx, type arg_type) -> const Char *
Definition: core.h:2309
@ long_short
Definition: core.h:1334
@ bool_set
Definition: core.h:638
@ uint_set
Definition: core.h:636
@ pointer_set
Definition: core.h:644
@ float_set
Definition: core.h:640
@ cstring_set
Definition: core.h:643
@ char_set
Definition: core.h:639
@ sint_set
Definition: core.h:634
@ string_set
Definition: core.h:642
FMT_CONSTEXPR auto parse_precision(const Char *begin, const Char *end, int &value, arg_ref< Char > &ref, basic_format_parse_context< Char > &ctx) -> const Char *
Definition: core.h:2293
constexpr FMT_INLINE auto is_constant_evaluated(bool default_value=false) noexcept -> bool
Definition: core.h:321
FMT_CONSTEXPR auto parse_align(const Char *begin, const Char *end, format_specs< Char > &specs) -> const Char *
Definition: format.h:2382
constexpr auto encode_types() -> unsigned long long
Definition: core.h:1566
FMT_FUNC void assert_fail(const char *file, int line, const char *message)
Definition: format-inl.h:30
auto find< false, char >(const char *first, const char *last, char value, const char *&out) -> bool
Definition: core.h:2162
constexpr auto format_as(Enum e) noexcept -> underlying_t< Enum >
Definition: format.h:4103
Implement std::hash so that hash_code can be used in STL containers.
Definition: array.h:89
static constexpr const unit_t< compound_unit< energy::joules, inverse< temperature::kelvin >, inverse< substance::moles > > > R(8.3144598)
Gas constant.
static constexpr const velocity::meters_per_second_t c(299792458.0)
Speed of light in vacuum.
UnitTypeLhs() max(const UnitTypeLhs &lhs, const UnitTypeRhs &rhs)
Definition: base.h:3419
constexpr const char * name(const T &)
FMT_CONSTEXPR FMT_INLINE auto args() const -> const T *
Definition: core.h:1188
FMT_CONSTEXPR FMT_INLINE arg_data(const U &... init)
Definition: core.h:1187
FMT_CONSTEXPR FMT_INLINE auto named_args() -> std::nullptr_t
Definition: core.h:1189
T args_[1+(NUM_ARGS !=0 ? NUM_ARGS :+1)]
Definition: core.h:1171
named_arg_info< Char > named_args_[NUM_NAMED_ARGS]
Definition: core.h:1172
auto args() const -> const T *
Definition: core.h:1177
arg_data(const arg_data &other)=delete
arg_data(const U &... init)
Definition: core.h:1175
auto named_args() -> named_arg_info< Char > *
Definition: core.h:1178
FMT_CONSTEXPR FMT_INLINE auto map(const char_type *val) -> const char_type *
Definition: core.h:1411
FMT_CONSTEXPR FMT_INLINE auto map(void *val) -> const void *
Definition: core.h:1428
FMT_CONSTEXPR FMT_INLINE auto map(long val) -> long_type
Definition: core.h:1368
FMT_CONSTEXPR FMT_INLINE auto map(uint128_opt val) -> uint128_opt
Definition: core.h:1380
FMT_CONSTEXPR FMT_INLINE auto map(T val) -> char_type
Definition: core.h:1387
FMT_CONSTEXPR FMT_INLINE auto map(int val) -> int
Definition: core.h:1366
FMT_CONSTEXPR FMT_INLINE auto map(long double val) -> long double
Definition: core.h:1404
FMT_CONSTEXPR FMT_INLINE auto map(char_type *val) -> const char_type *
Definition: core.h:1408
FMT_CONSTEXPR FMT_INLINE auto map(bool val) -> bool
Definition: core.h:1383
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long long val) -> unsigned long long
Definition: core.h:1373
FMT_CONSTEXPR FMT_INLINE auto map(const T(&values)[N]) -> const T(&)[N]
Definition: core.h:1451
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long val) -> ulong_type
Definition: core.h:1369
FMT_CONSTEXPR FMT_INLINE auto map(short val) -> int
Definition: core.h:1362
FMT_CONSTEXPR FMT_INLINE auto map(std::nullptr_t val) -> const void *
Definition: core.h:1432
auto map(...) -> unformattable
Definition: core.h:1494
FMT_CONSTEXPR FMT_INLINE auto map(const void *val) -> const void *
Definition: core.h:1429
FMT_CONSTEXPR FMT_INLINE auto map(int128_opt val) -> int128_opt
Definition: core.h:1377
FMT_CONSTEXPR FMT_INLINE auto map(float val) -> float
Definition: core.h:1402
FMT_CONSTEXPR FMT_INLINE auto do_map(T &) -> unformattable
Definition: core.h:1473
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char val) -> unsigned
Definition: core.h:1359
FMT_CONSTEXPR FMT_INLINE auto map(unsigned val) -> unsigned
Definition: core.h:1367
FMT_CONSTEXPR FMT_INLINE auto map(const T &named_arg) -> decltype(FMT_DECLTYPE_THIS map(named_arg.value))
Definition: core.h:1489
FMT_CONSTEXPR FMT_INLINE auto map(long long val) -> long long
Definition: core.h:1372
FMT_CONSTEXPR FMT_INLINE auto do_map(T &val) -> T &
Definition: core.h:1469
FMT_CONSTEXPR auto map(const T &) -> unformattable_pointer
Definition: core.h:1445
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> decltype(FMT_DECLTYPE_THIS map(U()))
Definition: core.h:1458
FMT_CONSTEXPR FMT_INLINE auto map(T &val) -> decltype(FMT_DECLTYPE_THIS do_map(val))
Definition: core.h:1483
FMT_CONSTEXPR FMT_INLINE auto map(double val) -> double
Definition: core.h:1403
FMT_CONSTEXPR FMT_INLINE auto map(const T &) -> unformattable_char
Definition: core.h:1424
FMT_CONSTEXPR FMT_INLINE auto map(signed char val) -> int
Definition: core.h:1358
typename Context::char_type char_type
Definition: core.h:1356
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> basic_string_view< char_type >
Definition: core.h:1417
FMT_CONSTEXPR FMT_INLINE auto map(T) -> unformattable_char
Definition: core.h:1398
FMT_CONSTEXPR FMT_INLINE auto map(unsigned short val) -> unsigned
Definition: core.h:1363
arg_id_kind kind
Definition: core.h:2115
FMT_CONSTEXPR arg_ref(basic_string_view< Char > name)
Definition: core.h:2106
FMT_CONSTEXPR arg_ref()
Definition: core.h:2102
FMT_CONSTEXPR auto operator=(int idx) -> arg_ref &
Definition: core.h:2109
FMT_CONSTEXPR arg_ref(int index)
Definition: core.h:2104
union detail::arg_ref::value val
auto limit(size_t size) -> size_t
Definition: core.h:904
auto count() const -> size_t
Definition: core.h:903
buffer_traits(size_t)
Definition: core.h:902
decltype(to_string_view(std::declval< S >())) result
Definition: core.h:569
typename result::value_type type
Definition: core.h:570
typename Context::parse_context_type parse_context
Definition: core.h:1251
void(* format)(void *arg, parse_context &parse_ctx, Context &ctx)
Definition: core.h:1253
void * value
Definition: core.h:1252
arg_ref< Char > & ref
Definition: core.h:2251
FMT_CONSTEXPR void on_name(basic_string_view< Char > id)
Definition: core.h:2263
FMT_CONSTEXPR void on_auto()
Definition: core.h:2253
FMT_CONSTEXPR void on_index(int id)
Definition: core.h:2258
basic_format_parse_context< Char > & ctx
Definition: core.h:2250
constexpr error_handler()=default
FMT_NORETURN void on_error(const char *message)
Definition: core.h:654
FMT_CONSTEXPR void operator=(basic_string_view< Char > s)
Definition: core.h:2036
constexpr auto data() const -> const Char *
Definition: core.h:2044
FMT_CONSTEXPR auto operator[](size_t index) const -> const Char &
Definition: core.h:2047
FMT_CONSTEXPR auto operator[](size_t index) -> Char &
Definition: core.h:2046
constexpr auto size() const -> size_t
Definition: core.h:2043
int id
Definition: core.h:1164
const Char * name
Definition: core.h:1163
const named_arg_info< Char > * data
Definition: core.h:1246
size_t size
Definition: core.h:1247
const T & value
Definition: core.h:1158
const Char * name
Definition: core.h:1157
named_arg(const Char *n, const T &v)
Definition: core.h:1159
const Char * data
Definition: core.h:1241
size_t size
Definition: core.h:1242
remove_cvref_t< decltype(T::value)> type
Definition: core.h:2576
T type
Definition: core.h:2573
Specifies if T is a character type.
Definition: core.h:522
constexpr monostate()
Definition: core.h:294
T type
Definition: core.h:282
basic_string_view< Char > name
Definition: core.h:2121
int index
Definition: core.h:2120
FMT_CONSTEXPR value(int idx=0)
Definition: core.h:2117
FMT_CONSTEXPR value(basic_string_view< Char > n)
Definition: core.h:2118
#define S(label, offset, message)
Definition: Errors.h:119