21#define FMT_VERSION 100100
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 (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE > 9)) || \
110 (FMT_CPLUSPLUS >= 201709L && FMT_GCC_VERSION >= 1002)
111# define FMT_CONSTEXPR20 constexpr
113# define FMT_CONSTEXPR20
117#if defined(__GLIBCXX__)
118# if FMT_CPLUSPLUS >= 201703L && defined(_GLIBCXX_RELEASE) && \
119 _GLIBCXX_RELEASE >= 7
120# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
122#elif defined(_LIBCPP_VERSION) && FMT_CPLUSPLUS >= 201703L && \
123 _LIBCPP_VERSION >= 4000
124# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
125#elif FMT_MSC_VERSION >= 1914 && FMT_CPLUSPLUS >= 201703L
126# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
128#ifndef FMT_CONSTEXPR_CHAR_TRAITS
129# define FMT_CONSTEXPR_CHAR_TRAITS
133#ifndef FMT_EXCEPTIONS
134# if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \
135 (FMT_MSC_VERSION && !_HAS_EXCEPTIONS)
136# define FMT_EXCEPTIONS 0
138# define FMT_EXCEPTIONS 1
143#if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VERSION && \
145# define FMT_NORETURN [[noreturn]]
151# if FMT_HAS_CPP17_ATTRIBUTE(nodiscard)
152# define FMT_NODISCARD [[nodiscard]]
154# define FMT_NODISCARD
159# if FMT_GCC_VERSION || FMT_CLANG_VERSION
160# define FMT_INLINE inline __attribute__((always_inline))
162# define FMT_INLINE inline
167# define FMT_UNCHECKED_ITERATOR(It) \
168 using _Unchecked_type = It
170# define FMT_UNCHECKED_ITERATOR(It) using unchecked_type = It
173#ifndef FMT_BEGIN_NAMESPACE
174# define FMT_BEGIN_NAMESPACE \
176 inline namespace v10 {
177# define FMT_END_NAMESPACE \
184# define FMT_BEGIN_EXPORT
185# define FMT_END_EXPORT
188#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
189# ifdef FMT_LIB_EXPORT
190# define FMT_API __declspec(dllexport)
191# elif defined(FMT_SHARED)
192# define FMT_API __declspec(dllimport)
195# if defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
196# if defined(__GNUC__) || defined(__clang__)
197# define FMT_API __attribute__((visibility("default")))
206#if FMT_HAS_INCLUDE(<string_view>) && \
207 (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
208# include <string_view>
209# define FMT_USE_STRING_VIEW
210#elif FMT_HAS_INCLUDE("experimental/string_view") && FMT_CPLUSPLUS >= 201402L
211# include <experimental/string_view>
212# define FMT_USE_EXPERIMENTAL_STRING_VIEW
216# define FMT_UNICODE !FMT_MSC_VERSION
220# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
221 (!defined(__apple_build_version__) || \
222 __apple_build_version__ >= 14000029L) && \
223 FMT_CPLUSPLUS >= 202002L) || \
224 (defined(__cpp_consteval) && \
225 (!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704))
227# define FMT_CONSTEVAL consteval
228# define FMT_HAS_CONSTEVAL
230# define FMT_CONSTEVAL
234#ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS
235# if defined(__cpp_nontype_template_args) && \
236 ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \
237 __cpp_nontype_template_args >= 201911L) && \
238 !defined(__NVCOMPILER) && !defined(__LCC__)
239# define FMT_USE_NONTYPE_TEMPLATE_ARGS 1
241# define FMT_USE_NONTYPE_TEMPLATE_ARGS 0
247#if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) && !defined(__LCC__) && \
255template <
bool B,
typename T =
void>
257template <
bool B,
typename T,
typename F>
273template <
typename Char>
284# define FMT_ENABLE_IF(...)
286# define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0
292template <
typename T, FMT_ENABLE_IF(std::is_same<T, std::
byte>::value)>
294 return static_cast<unsigned char>(
b);
305 bool default_value =
false) noexcept ->
bool {
309#if FMT_CPLUSPLUS >= 202002L && defined(_GLIBCXX_RELEASE) && \
310 _GLIBCXX_RELEASE >= 12 && \
311 (FMT_CLANG_VERSION >= 1400 && FMT_CLANG_VERSION < 1500)
313 return __builtin_is_constant_evaluated();
314#elif defined(__cpp_lib_is_constant_evaluated)
318 return default_value;
328 const char* message);
333# define FMT_ASSERT(condition, message) \
334 fmt::detail::ignore_unused((condition), (message))
336# define FMT_ASSERT(condition, message) \
339 : fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
343#if defined(FMT_USE_STRING_VIEW)
344template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
345#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
346template <
typename Char>
347using std_string_view = std::experimental::basic_string_view<Char>;
354#elif defined(__SIZEOF_INT128__) && !defined(__NVCC__) && \
355 !(FMT_CLANG_VERSION && FMT_MSC_VERSION)
356# define FMT_USE_INT128 1
363# define FMT_USE_INT128 0
373template <
typename Int>
376 FMT_ASSERT(std::is_unsigned<Int>::value ||
value >= 0,
"negative value");
381 FMT_MSC_WARNING(suppress : 4566)
constexpr unsigned char section[] =
"\u00A7";
384 using uchar =
unsigned char;
385 return FMT_UNICODE || (
sizeof(section) == 3 && uchar(section[0]) == 0xC2 &&
386 uchar(section[1]) == 0xA7);
411 : data_(s), size_(
count) {}
425 ?
std::strlen(reinterpret_cast<const char*>(s))
426 :
std::char_traits<Char>::length(s)) {}
429 template <
typename Traits,
typename Alloc>
431 const std::basic_string<Char, Traits, Alloc>& s) noexcept
432 : data_(s.data()), size_(s.size()) {}
437 : data_(s.data()), size_(s.size()) {}
440 constexpr auto data() const noexcept -> const Char* {
return data_; }
443 constexpr auto size() const noexcept ->
size_t {
return size_; }
446 constexpr auto end() const noexcept ->
iterator {
return data_ + size_; }
448 constexpr auto operator[](
size_t pos)
const noexcept ->
const Char& {
459 return size_ >= sv.size_ &&
460 std::char_traits<Char>::compare(data_, sv.data_, sv.size_) == 0;
463 return size_ >= 1 && std::char_traits<Char>::eq(*data_,
c);
471 size_t str_size = size_ < other.size_ ? size_ : other.size_;
472 int result = std::char_traits<Char>::compare(data_, other.data_, str_size);
474 result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
481 return lhs.compare(rhs) == 0;
484 return lhs.compare(rhs) != 0;
487 return lhs.compare(rhs) < 0;
490 return lhs.compare(rhs) <= 0;
493 return lhs.compare(rhs) > 0;
496 return lhs.compare(rhs) >= 0;
505template <
typename T>
struct is_char : std::false_type {};
506template <>
struct is_char<char> : std::true_type {};
516template <
typename Char, FMT_ENABLE_IF(is_
char<Char>::value)>
520template <
typename Char,
typename Traits,
typename Alloc>
525template <
typename Char>
530template <
typename Char,
535template <
typename S, FMT_ENABLE_IF(is_compile_
string<S>::value)>
548 : std::is_class<decltype(detail::to_string_view(std::declval<S>()))> {};
553 using type =
typename result::value_type;
580template <
typename T,
typename Char>
583#define FMT_TYPE_CONSTANT(Type, constant) \
584 template <typename Char> \
585 struct type_constant<Type, Char> \
586 : std::integral_constant<type, type::constant> {}
610constexpr auto set(
type rhs) ->
int {
return 1 <<
static_cast<int>(rhs); }
612 return ((
set >>
static_cast<int>(t)) & 1) != 0;
669 : format_str_(format_str), next_arg_id_(
next_arg_id) {}
676 return format_str_.
begin();
694 if (next_arg_id_ < 0) {
696 "cannot switch from manual to automatic argument indexing");
699 int id = next_arg_id_++;
709 if (next_arg_id_ > 0) {
711 "cannot switch from automatic to manual argument indexing");
726template <
typename Char>
739 constexpr auto num_args() const ->
int {
return num_args_; }
764template <
typename Container>
767 using base = std::back_insert_iterator<Container>;
768 struct accessor : base {
769 accessor(base
b) : base(
b) {}
770 using base::container;
772 return *accessor(it).container;
775template <
typename Char,
typename InputIt,
typename OutputIt>
778 while (begin != end) *out++ =
static_cast<Char
>(*begin++);
782template <
typename Char,
typename T,
typename U,
788 if (size > 0) memcpy(out, begin, size *
sizeof(U));
807 buffer(
size_t sz) noexcept : size_(sz), capacity_(sz) {}
810 : ptr_(p), size_(sz), capacity_(cap) {}
818 capacity_ = buf_capacity;
838 constexpr auto size() const noexcept ->
size_t {
return size_; }
841 constexpr auto capacity() const noexcept ->
size_t {
return capacity_; }
854 size_ =
count <= capacity_ ?
count : capacity_;
862 if (new_capacity > capacity_)
grow(new_capacity);
867 ptr_[size_++] =
value;
876 template <
typename Idx>
884 auto count() const ->
size_t {
return 0; }
885 auto limit(
size_t size) ->
size_t {
return size; }
895 auto count() const ->
size_t {
return count_; }
897 size_t n = limit_ > count_ ? limit_ - count_ : 0;
899 return size < n ? size : n;
904template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
908 enum { buffer_size = 256 };
909 T data_[buffer_size];
913 if (this->
size() == buffer_size)
flush();
919 out_ = copy_str<T>(data_, data_ + this->
limit(
size), out_);
924 : Traits(n),
buffer<T>(data_, 0, buffer_size), out_(
out) {}
926 : Traits(other),
buffer<T>(data_, 0, buffer_size), out_(other.out_) {}
942 enum { buffer_size = 256 };
943 T data_[buffer_size];
947 if (this->size() == this->capacity()) flush();
951 size_t n = this->limit(this->size());
952 if (this->
data() == out_) {
954 this->
set(data_, buffer_size);
966 if (this->
data() != out_) {
967 this->
set(data_, buffer_size);
989 auto out() -> T* {
return &*this->end(); }
993template <
typename Container>
996 typename Container::value_type>>
997 final :
public buffer<typename Container::value_type> {
999 Container& container_;
1013 auto out() -> std::back_insert_iterator<Container> {
1014 return std::back_inserter(container_);
1021 enum { buffer_size = 256 };
1022 T data_[buffer_size];
1027 if (this->
size() != buffer_size)
return;
1028 count_ += this->
size();
1039template <
typename Char>
1046 if (
id >=
static_cast<context*
>(
this)->num_args())
1051template <
typename Char>
1057 static_cast<context*
>(
this)->check_dynamic_spec(arg_id);
1067template <
typename T,
typename Char =
char,
typename Enable =
void>
1075template <
typename T,
typename Context>
1077 std::is_constructible<typename Context::template formatter_type<T>>;
1081class appender :
public std::back_insert_iterator<detail::buffer<char>> {
1082 using base = std::back_insert_iterator<detail::buffer<char>>;
1095template <
typename Context,
typename T>
1097 ->
decltype(
typename Context::template formatter_type<T>().format(
1098 std::declval<const T&>(), std::declval<Context&>()),
1102template <
typename Context>
1106template <
typename T,
typename Context>
1108 return has_const_formatter_impl<Context>(
static_cast<T*
>(
nullptr));
1111template <
typename T>
1113 std::back_insert_iterator<buffer<T>>>;
1116template <
typename T,
typename OutputIt>
1120template <
typename T,
typename Buf,
1126template <
typename Buf,
typename OutputIt>
1130template <
typename T,
typename OutputIt>
1148template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1152 T
args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
1155 template <
typename... U>
1162template <
typename T,
typename Char,
size_t NUM_ARGS>
1167 template <
typename... U>
1175template <
typename Char>
1181template <
typename T,
typename Char>
1184template <
typename Char,
typename T,
typename... Tail,
1187 int named_arg_count,
const T&,
const Tail&... args) {
1191template <
typename Char,
typename T,
typename... Tail,
1194 int named_arg_count,
const T&
arg,
const Tail&... args) {
1195 named_args[named_arg_count++] = {
arg.name, arg_count};
1199template <
typename... Args>
1203template <
bool B = false>
constexpr auto count() ->
size_t {
return B ? 1 : 0; }
1204template <
bool B1,
bool B2,
bool... Tail>
constexpr auto count() ->
size_t {
1205 return (B1 ? 1 : 0) +
count<B2, Tail...>();
1209 return count<is_named_arg<Args>::value...>();
1212template <
typename... Args>
1214 return count<is_statically_named_arg<Args>::value...>();
1238template <
typename Context>
class value {
1278 string.data = val.
data();
1279 string.size = val.
size();
1287 custom.value =
const_cast<value_type*
>(std::addressof(val));
1291 custom.format = format_custom_arg<
1292 value_type,
typename Context::template formatter_type<value_type>>;
1300 template <
typename T,
typename Formatter>
1301 static void format_custom_arg(
void*
arg,
1302 typename Context::parse_context_type& parse_ctx,
1304 auto f = Formatter();
1305 parse_ctx.advance_to(f.parse(parse_ctx));
1306 using qualified_type =
1308 ctx.advance_to(f.format(*
static_cast<qualified_type*
>(
arg), ctx));
1319 template <
typename U,
1320 FMT_ENABLE_IF(std::is_enum<U>::value || std::is_class<U>::value)>
1324 using type =
decltype(
map(
static_cast<T*
>(
nullptr)));
1328template <
typename T>
1330 :
bool_constant<!std::is_same<format_as_t<T>, void>::value> {};
1354 ->
unsigned long long {
1365 template <
typename T, FMT_ENABLE_IF(std::is_same<T,
char>::value ||
1366 std::is_same<T,
char_type>::value)>
1370 template <
typename T, enable_if_t<(std::is_same<T,
wchar_t>::value ||
1372 std::is_same<T,
char8_t>::value ||
1374 std::is_same<T,
char16_t>::value ||
1375 std::is_same<T,
char32_t>::value) &&
1376 !std::is_same<T,
char_type>::value,
1394 template <
typename T,
1401 template <
typename T,
1421 std::is_pointer<T>::value || std::is_member_pointer<T>::value ||
1423 (std::is_array<T>::value &&
1424 !std::is_convertible<T, const char_type*>::value))>
1429 template <
typename T, std::size_t N,
1436 template <
typename T,
typename U = format_as_t<T>,
1437 FMT_ENABLE_IF(std::is_arithmetic<U>::value)>
1442 template <
typename T,
typename U = remove_const_t<T>>
1444 (has_formatter<U, Context>::value &&
1445 !std::is_const<T>::value)> {};
1447 template <
typename T, FMT_ENABLE_IF(formattable<T>::value)>
1451 template <
typename T, FMT_ENABLE_IF(!formattable<T>::value)>
1456 template <
typename T,
typename U = remove_const_t<T>,
1457 FMT_ENABLE_IF((std::is_
class<U>::value || std::is_enum<U>::value ||
1458 std::is_union<U>::value) &&
1459 !is_
string<U>::value && !is_
char<U>::value &&
1460 !is_named_arg<U>::value &&
1461 !std::is_arithmetic<format_as_t<U>>::value)>
1466 template <
typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
1476template <
typename T,
typename Context>
1479 typename Context::char_type>;
1487template <
typename Char,
typename InputIt>
1492template <
typename Char,
typename InputIt>
1494 std::back_insert_iterator<std::string> out)
1495 -> std::back_insert_iterator<std::string> {
1500template <
typename Char,
typename R,
typename OutputIt>
1502 return detail::copy_str<Char>(rng.begin(), rng.end(), out);
1505#if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
1507template <
typename...>
struct void_t_impl {
using type = void; };
1508template <
typename... T>
using void_t =
typename void_t_impl<T...>
::type;
1513template <
typename It,
typename T,
typename Enable =
void>
1516template <
typename It,
typename T>
1520 decltype(*std::declval<It>() = std::declval<T>())>>
1521 : std::true_type {};
1524template <
typename Container>
1526 : std::true_type {};
1531 const void* locale_;
1535 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1537 explicit operator bool() const noexcept {
return locale_ !=
nullptr; }
1539 template <
typename Locale>
auto get() const -> Locale;
1546template <
typename Context,
typename Arg,
typename... Args>
1552#if defined(__cpp_if_constexpr)
1554template <
typename T,
typename Char>
struct type_is_unformattable_for;
1557template <
bool PACKED,
typename Context,
typename T, FMT_ENABLE_IF(PACKED)>
1561 constexpr bool formattable_char =
1562 !std::is_same<arg_type, unformattable_char>::value;
1563 static_assert(formattable_char,
"Mixing character types is disallowed.");
1568 constexpr bool formattable_pointer =
1569 !std::is_same<arg_type, unformattable_pointer>::value;
1570 static_assert(formattable_pointer,
1571 "Formatting of non-void pointers is disallowed.");
1573 constexpr bool formattable = !std::is_same<arg_type, unformattable>::value;
1574#if defined(__cpp_if_constexpr)
1575 if constexpr (!formattable) {
1576 type_is_unformattable_for<T, typename Context::char_type> _;
1581 "Cannot format an argument. To make type T formattable provide a "
1582 "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
1586template <
typename Context,
typename T>
1590 arg.value_ = make_arg<true, Context>(val);
1594template <
bool PACKED,
typename Context,
typename T, FMT_ENABLE_IF(!PACKED)>
1596 return make_arg<Context>(val);
1608 template <
typename ContextType,
typename T>
1612 template <
typename Visitor,
typename Ctx>
1615 ->
decltype(vis(0));
1620 using char_type =
typename Context::char_type;
1622 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1626 : value_(
args, size) {}
1633 void format(
typename Context::parse_context_type& parse_ctx,
1634 Context& ctx)
const {
1635 custom_.format(custom_.value, parse_ctx, ctx);
1644 constexpr explicit operator bool() const noexcept {
1664template <
typename Visitor,
typename Context>
1667 switch (
arg.type_) {
1671 return vis(
arg.value_.int_value);
1673 return vis(
arg.value_.uint_value);
1675 return vis(
arg.value_.long_long_value);
1677 return vis(
arg.value_.ulong_long_value);
1683 return vis(
arg.value_.bool_value);
1685 return vis(
arg.value_.char_value);
1687 return vis(
arg.value_.float_value);
1689 return vis(
arg.value_.double_value);
1691 return vis(
arg.value_.long_double_value);
1693 return vis(
arg.value_.string.data);
1696 return vis(sv(
arg.value_.string.data,
arg.value_.string.size));
1698 return vis(
arg.value_.pointer);
1731 : out_(out), args_(ctx_args), loc_(loc) {}
1735 return args_.
get(name);
1738 return args_.
get_id(name);
1743 void on_error(
const char* message) { error_handler().on_error(message); }
1756template <
typename Char>
1761template <
typename T,
typename Char =
char>
1764 .
map(std::declval<T&>()))>::value>;
1773template <
typename Context,
typename... Args>
1781 static const size_t num_args =
sizeof...(Args);
1794 static constexpr unsigned long long desc =
1797 (num_named_args != 0
1802 template <
typename... T>
1840template <
typename Char,
typename T>
1867 unsigned long long desc_;
1878 constexpr auto is_packed() const ->
bool {
1881 auto has_named_args() const ->
bool {
1888 return static_cast<detail::type>((desc_ >> shift) & mask);
1893 : desc_(desc), values_(values) {}
1895 : desc_(desc), args_(args) {}
1905 template <
typename... Args>
1909 store.data_.args()) {}
1934 if (
id < max_size())
arg = args_[id];
1940 arg.value_ = values_[id];
1944 template <
typename Char>
1946 int id = get_id(name);
1950 template <
typename Char>
1952 if (!has_named_args())
return -1;
1953 const auto& named_args =
1954 (is_packed() ? values_[-1] : args_[-1].value_).named_args;
1955 for (
size_t i = 0; i < named_args.size; ++i) {
1956 if (named_args.data[i].name == name)
return named_args.data[i].id;
1963 return static_cast<int>(is_packed() ? max_packed
1977#if FMT_GCC_VERSION && FMT_GCC_VERSION < 903
1978# define FMT_ENUM_UNDERLYING_TYPE(type)
1980# define FMT_ENUM_UNDERLYING_TYPE(type) : type
1997 enum { max_size = 4 };
1998 Char data_[max_size] = {Char(
' '), Char(0), Char(0), Char(0)};
1999 unsigned char size_ = 1;
2005 for (
size_t i = 0; i <
size; ++i) data_[i] = s[i];
2006 size_ =
static_cast<unsigned char>(
size);
2009 constexpr auto size() const ->
size_t {
return size_; }
2010 constexpr auto data() const -> const Char* {
return data_; }
2014 return data_[
index];
2094template <
typename Char =
char>
2101template <
typename Char, FMT_ENABLE_IF(std::is_
integral<Char>::value)>
2103 return c <= 0xff ? static_cast<char>(
c) :
'\0';
2105template <
typename Char, FMT_ENABLE_IF(std::is_enum<Char>::value)>
2106constexpr auto to_ascii(Char
c) ->
char {
2107 return c <= 0xff ? static_cast<char>(
c) :
'\0';
2111template <
typename Char>
2114 auto c =
static_cast<unsigned char>(*begin);
2115 return static_cast<int>((0x3a55000000000000ull >> (2 * (
c >> 3))) & 0x3) + 1;
2119template <
bool IS_CONSTEXPR,
typename T,
typename Ptr = const T*>
2121 for (out =
first; out != last; ++out) {
2122 if (*out ==
value)
return true;
2129 const char*& out) ->
bool {
2130 out =
static_cast<const char*
>(
2132 return out !=
nullptr;
2137template <
typename Char>
2139 int error_value)
noexcept ->
int {
2140 FMT_ASSERT(begin != end &&
'0' <= *begin && *begin <=
'9',
"");
2141 unsigned value = 0, prev = 0;
2147 }
while (p != end &&
'0' <= *p && *p <=
'9');
2148 auto num_digits = p - begin;
2151 return static_cast<int>(
value);
2155 prev * 10ull + unsigned(p[-1] -
'0') <=
max
2156 ?
static_cast<int>(
value)
2165 return align::right;
2167 return align::center;
2173 return (
'a' <=
c &&
c <=
'z') || (
'A' <=
c &&
c <=
'Z') ||
c ==
'_';
2176template <
typename Char,
typename Handler>
2178 Handler&& handler) ->
const Char* {
2180 if (
c >=
'0' &&
c <=
'9') {
2187 if (begin == end || (*begin !=
'}' && *begin !=
':'))
2190 handler.on_index(
index);
2200 }
while (it != end && (
is_name_start(*it) || (
'0' <= *it && *it <=
'9')));
2201 handler.on_name({begin,
to_unsigned(it - begin)});
2205template <
typename Char,
typename Handler>
2207 Handler&& handler) ->
const Char* {
2220 int id =
ctx.next_arg_id();
2222 ctx.check_dynamic_spec(
id);
2226 ctx.check_arg_id(
id);
2227 ctx.check_dynamic_spec(
id);
2231 ctx.check_arg_id(
id);
2236template <
typename Char>
2242 if (
'0' <= *begin && *begin <=
'9') {
2248 }
else if (*begin ==
'{') {
2251 if (begin != end) begin =
parse_arg_id(begin, end, handler);
2252 if (begin != end && *begin ==
'}')
return ++begin;
2258template <
typename Char>
2264 if (begin == end || *begin ==
'}') {
2274template <
typename Char>
2279 if (end - begin > 1) {
2283 if (begin == end)
return begin;
2290 if (current_state >= s || !valid)
2308 } parse_presentation_type{begin, specs, arg_type};
2325 specs.sign = sign::plus;
2328 specs.sign = sign::minus;
2331 specs.sign = sign::space;
2345 if (specs.align == align::none) {
2347 specs.align = align::numeric;
2348 specs.fill[0] = Char(
'0');
2368 begin =
parse_precision(begin, end, specs.precision, specs.precision_ref,
2373 specs.localized =
true;
2377 return parse_presentation_type(pres::dec, integral_set);
2379 return parse_presentation_type(pres::oct, integral_set);
2381 return parse_presentation_type(pres::hex_lower, integral_set);
2383 return parse_presentation_type(pres::hex_upper, integral_set);
2385 return parse_presentation_type(pres::bin_lower, integral_set);
2387 return parse_presentation_type(pres::bin_upper, integral_set);
2389 return parse_presentation_type(pres::hexfloat_lower,
float_set);
2391 return parse_presentation_type(pres::hexfloat_upper,
float_set);
2393 return parse_presentation_type(pres::exp_lower,
float_set);
2395 return parse_presentation_type(pres::exp_upper,
float_set);
2397 return parse_presentation_type(pres::fixed_lower,
float_set);
2399 return parse_presentation_type(pres::fixed_upper,
float_set);
2401 return parse_presentation_type(pres::general_lower,
float_set);
2403 return parse_presentation_type(pres::general_upper,
float_set);
2405 return parse_presentation_type(pres::chr, integral_set);
2407 return parse_presentation_type(pres::string,
2412 return parse_presentation_type(pres::debug,
2417 if (*begin ==
'}')
return begin;
2420 if (end - fill_end <= 0) {
2424 if (*begin ==
'{') {
2430 specs.fill = {begin,
to_unsigned(fill_end - begin)};
2431 specs.align =
align;
2432 begin = fill_end + 1;
2435 if (begin == end)
return begin;
2440template <
typename Char,
typename Handler>
2442 Handler&& handler) ->
const Char* {
2447 FMT_CONSTEXPR void on_auto() { arg_id = handler.on_arg_id(); }
2448 FMT_CONSTEXPR void on_index(
int id) { arg_id = handler.on_arg_id(
id); }
2450 arg_id = handler.on_arg_id(
id);
2455 if (begin == end)
return handler.on_error(
"invalid format string"), end;
2456 if (*begin ==
'}') {
2457 handler.on_replacement_field(handler.on_arg_id(), begin);
2458 }
else if (*begin ==
'{') {
2459 handler.on_text(begin, begin + 1);
2461 auto adapter = id_adapter{handler, 0};
2463 Char
c = begin != end ? *begin : Char();
2465 handler.on_replacement_field(adapter.arg_id, begin);
2466 }
else if (
c ==
':') {
2467 begin = handler.on_format_specs(adapter.arg_id, begin + 1, end);
2468 if (begin == end || *begin !=
'}')
2469 return handler.on_error(
"unknown format specifier"), end;
2471 return handler.on_error(
"missing '}' in format string"), end;
2477template <
bool IS_CONSTEXPR,
typename Char,
typename Handler>
2480 auto begin = format_str.
data();
2481 auto end = begin + format_str.
size();
2482 if (end - begin < 32) {
2484 const Char* p = begin;
2488 handler.on_text(begin, p - 1);
2490 }
else if (
c ==
'}') {
2491 if (p == end || *p !=
'}')
2492 return handler.on_error(
"unmatched '}' in format string");
2493 handler.on_text(begin, p);
2497 handler.on_text(begin, end);
2502 if (
from == to)
return;
2504 const Char* p =
nullptr;
2505 if (!find<IS_CONSTEXPR>(
from, to, Char(
'}'), p))
2506 return handler_.on_text(
from, to);
2508 if (p == to || *p !=
'}')
2509 return handler_.
on_error(
"unmatched '}' in format string");
2510 handler_.on_text(
from, p);
2515 }
write = {handler};
2516 while (begin != end) {
2519 const Char* p = begin;
2520 if (*begin !=
'{' && !find<IS_CONSTEXPR>(begin + 1, end, Char(
'{'), p))
2521 return write(begin, end);
2534template <
typename T,
typename ParseContext>
2536 ->
decltype(ctx.begin()) {
2537 using char_type =
typename ParseContext::char_type;
2543#if defined(__cpp_if_constexpr)
2544 if constexpr (std::is_default_constructible_v<
2548 type_is_unformattable_for<T, char_type> _;
2557template <
typename Char>
2564 if (specs.align == align::numeric || specs.sign != sign::none || specs.alt)
2569#if FMT_USE_NONTYPE_TEMPLATE_ARGS
2570template <
int N,
typename T,
typename... Args,
typename Char>
2572 if constexpr (is_statically_named_arg<T>()) {
2573 if (name ==
T::name)
return N;
2575 if constexpr (
sizeof...(Args) > 0)
2582template <
typename... Args,
typename Char>
2584#if FMT_USE_NONTYPE_TEMPLATE_ARGS
2585 if constexpr (
sizeof...(Args) > 0)
2595 static constexpr int num_args =
sizeof...(Args);
2603 type types_[num_args > 0 ?
static_cast<size_t>(num_args) : 1];
2605 parse_func parse_funcs_[num_args > 0 ?
static_cast<size_t>(num_args) : 1];
2610 context_(fmt, num_args, types_),
2617 return context_.check_arg_id(
id), id;
2620#if FMT_USE_NONTYPE_TEMPLATE_ARGS
2626 on_error(
"compile-time checks for named arguments require C++20 support");
2639 return id >= 0 &&
id < num_args ? parse_funcs_[id](context_) : begin;
2648template <
typename...,
typename S,
FMT_ENABLE_IF(!is_compile_string<S>::value)>
2650#ifdef FMT_ENFORCE_COMPILE_STRING
2652 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use "
2656template <
typename... Args,
typename S,
2659 using char_t =
typename S::char_type;
2673template <
typename Char>
2686template <
typename T,
typename Char>
2694 template <
typename ParseContext>
2703 template <detail::type U = detail::type_constant<T, Char>::value,
2711 template <
typename FormatContext>
2713 ->
decltype(ctx.out());
2726 template <
typename S,
2732 (std::is_base_of<detail::view, remove_reference_t<Args>>::value &&
2733 std::is_reference<Args>::value)...>() == 0,
2734 "passing views as lvalues is disallowed");
2735#ifdef FMT_HAS_CONSTEVAL
2737 detail::count_statically_named_args<Args...>()) {
2740 detail::parse_format_string<true>(str_, checker(s));
2752#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
2757template <
typename... Args>
2785template <
typename... T>
2792template <
typename OutputIt,
2795 auto&& buf = detail::get_buffer<char>(out);
2812template <
typename OutputIt,
typename... T,
2826template <
typename OutputIt,
typename... T,
2833 return {buf.out(), buf.count()};
2844template <
typename OutputIt,
typename... T,
2852template <
typename... T>
2854 T&&... args) ->
size_t {
2873template <
typename... T>
2890template <
typename... T>
2901template <
typename... T>
2910template <
typename... T>
2912 return fmt::println(stdout, fmt, std::forward<T>(args)...);
2919#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:289
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:192
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:128
appender(base it) noexcept
Definition: core.h:1086
auto operator++() noexcept -> appender &
Definition: core.h:1089
auto operator++(int) noexcept -> appender
Definition: core.h:1090
FMT_UNCHECKED_ITERATOR(appender)
basic_format_context(const basic_format_context &)=delete
OutputIt iterator
Definition: core.h:1713
FMT_CONSTEXPR auto locale() -> detail::locale_ref
Definition: core.h:1753
auto args() const -> const format_args &
Definition: core.h:1740
FMT_CONSTEXPR auto out() -> iterator
Definition: core.h:1746
Char char_type
The character type for the output.
Definition: core.h:1720
void on_error(const char *message)
Definition: core.h:1743
FMT_CONSTEXPR auto error_handler() -> detail::error_handler
Definition: core.h:1742
constexpr auto arg(int id) const -> format_arg
Definition: core.h:1733
void advance_to(iterator it)
Definition: core.h:1749
basic_format_context(basic_format_context &&)=default
FMT_CONSTEXPR auto arg(basic_string_view< Char > name) -> format_arg
Definition: core.h:1734
FMT_CONSTEXPR auto arg_id(basic_string_view< Char > name) -> int
Definition: core.h:1737
constexpr basic_format_context(OutputIt out, format_args ctx_args, detail::locale_ref loc={})
Constructs a basic_format_context object.
Definition: core.h:1729
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:656
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:693
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
Definition: core.h:1052
const Char * iterator
Definition: core.h:665
constexpr auto end() const noexcept -> iterator
Returns an iterator past the end of the format string range being parsed.
Definition: core.h:682
Char char_type
Definition: core.h:664
constexpr basic_format_parse_context(basic_string_view< Char > format_str, int next_arg_id=0)
Definition: core.h:667
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:708
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
Definition: core.h:717
FMT_CONSTEXPR void advance_to(iterator it)
Advances the begin iterator to it.
Definition: core.h:685
constexpr auto begin() const noexcept -> iterator
Returns an iterator to the beginning of the format string range being parsed.
Definition: core.h:675
An implementation of std::basic_string_view for pre-C++17.
Definition: core.h:398
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:430
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(Char c) const noexcept
Definition: core.h:462
constexpr auto end() const noexcept -> iterator
Definition: core.h:446
const Char * iterator
Definition: core.h:405
constexpr auto size() const noexcept -> size_t
Returns the string size.
Definition: core.h:443
constexpr auto data() const noexcept -> const Char *
Returns a pointer to the string data.
Definition: core.h:440
FMT_CONSTEXPR_CHAR_TRAITS friend auto operator==(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:478
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:492
constexpr auto begin() const noexcept -> iterator
Definition: core.h:445
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:486
Char value_type
Definition: core.h:404
FMT_CONSTEXPR basic_string_view(S s) noexcept
Definition: core.h:436
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:489
FMT_CONSTEXPR void remove_prefix(size_t n) noexcept
Definition: core.h:452
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:421
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(basic_string_view< Char > sv) const noexcept
Definition: core.h:457
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:483
constexpr auto operator[](size_t pos) const noexcept -> const Char &
Definition: core.h:448
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:410
constexpr basic_string_view() noexcept
Definition: core.h:407
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(const Char *s) const
Definition: core.h:465
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:495
FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int
Definition: core.h:470
\rst A contiguous memory buffer with an optional growing ability.
Definition: core.h:798
FMT_CONSTEXPR20 void push_back(const T &value)
Definition: core.h:865
FMT_INLINE auto end() noexcept -> T *
Definition: core.h:832
FMT_CONSTEXPR20 buffer(T *p=nullptr, size_t sz=0, size_t cap=0) noexcept
Definition: core.h:809
FMT_CONSTEXPR20 void try_reserve(size_t new_capacity)
Definition: core.h:861
FMT_CONSTEXPR20 void try_resize(size_t count)
Definition: core.h:852
T value_type
Definition: core.h:825
FMT_CONSTEXPR void set(T *buf_data, size_t buf_capacity) noexcept
Sets the buffer data and capacity.
Definition: core.h:816
FMT_CONSTEXPR auto operator[](Idx index) const -> const T &
Definition: core.h:877
FMT_INLINE auto begin() const noexcept -> const T *
Definition: core.h:834
void clear()
Clears this buffer.
Definition: core.h:848
constexpr auto size() const noexcept -> size_t
Returns the size of this buffer.
Definition: core.h:838
FMT_CONSTEXPR auto data() const noexcept -> const T *
Definition: core.h:845
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:841
FMT_CONSTEXPR20 ~buffer()=default
const T & const_reference
Definition: core.h:826
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:873
void operator=(const buffer &)=delete
FMT_CONSTEXPR auto data() noexcept -> T *
Returns a pointer to the buffer data (not null-terminated).
Definition: core.h:844
buffer(buffer &&)=default
FMT_INLINE auto begin() noexcept -> T *
Definition: core.h:831
FMT_INLINE auto end() const noexcept -> const T *
Definition: core.h:835
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:734
constexpr auto num_args() const -> int
Definition: core.h:739
FMT_CONSTEXPR auto next_arg_id() -> int
Definition: core.h:742
FMT_CONSTEXPR void check_arg_id(int id)
Definition: core.h:748
constexpr auto arg_type(int id) const -> type
Definition: core.h:740
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
Definition: core.h:754
counting_buffer()
Definition: core.h:1033
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:1026
auto count() -> size_t
Definition: core.h:1035
auto count() const -> size_t
Definition: core.h:895
auto limit(size_t size) -> size_t
Definition: core.h:896
fixed_buffer_traits(size_t limit)
Definition: core.h:894
~iterator_buffer()
Definition: core.h:971
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:946
auto count() const -> size_t
Definition: core.h:977
iterator_buffer(iterator_buffer &&other)
Definition: core.h:962
iterator_buffer(T *out, size_t n=buffer_size)
Definition: core.h:960
auto out() -> T *
Definition: core.h:973
void flush()
Definition: core.h:950
auto out() -> T *
Definition: core.h:989
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:984
iterator_buffer(T *out, size_t=0)
Definition: core.h:987
FMT_CONSTEXPR20 void grow(size_t capacity) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:1002
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
Definition: core.h:1010
auto out() -> std::back_insert_iterator< Container >
Definition: core.h:1013
iterator_buffer(Container &c)
Definition: core.h:1008
void flush()
Definition: core.h:916
FMT_CONSTEXPR20 void grow(size_t) override
Increases the buffer capacity to hold at least capacity elements.
Definition: core.h:912
iterator_buffer(iterator_buffer &&other)
Definition: core.h:925
iterator_buffer(OutputIt out, size_t n=buffer_size)
Definition: core.h:923
auto count() const -> size_t
Definition: core.h:933
~iterator_buffer()
Definition: core.h:927
auto out() -> OutputIt
Definition: core.h:929
constexpr FMT_INLINE locale_ref()
Definition: core.h:1534
auto get() const -> Locale
value(unformattable_char)
FMT_CONSTEXPR FMT_INLINE value(const char_type *val)
Definition: core.h:1273
int int_value
Definition: core.h:1244
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
Definition: core.h:1282
FMT_CONSTEXPR20 FMT_INLINE value(T &val)
Definition: core.h:1285
uint128_opt uint128_value
Definition: core.h:1249
constexpr FMT_INLINE value(long long val)
Definition: core.h:1264
bool bool_value
Definition: core.h:1250
FMT_INLINE value(uint128_opt val)
Definition: core.h:1267
unsigned long long ulong_long_value
Definition: core.h:1247
double double_value
Definition: core.h:1253
long double long_double_value
Definition: core.h:1254
constexpr FMT_INLINE value(unsigned val)
Definition: core.h:1263
constexpr FMT_INLINE value(float val)
Definition: core.h:1268
constexpr FMT_INLINE value(unsigned long long val)
Definition: core.h:1265
FMT_INLINE value(long double val)
Definition: core.h:1270
float float_value
Definition: core.h:1252
value(unformattable_pointer)
constexpr FMT_INLINE value()
Definition: core.h:1261
int128_opt int128_value
Definition: core.h:1248
constexpr FMT_INLINE value(double val)
Definition: core.h:1269
custom_value< Context > custom
Definition: core.h:1257
FMT_INLINE value(const void *val)
Definition: core.h:1281
named_arg_value< char_type > named_args
Definition: core.h:1258
constexpr FMT_INLINE value(int val)
Definition: core.h:1262
FMT_INLINE value(int128_opt val)
Definition: core.h:1266
char_type char_value
Definition: core.h:1251
string_value< char_type > string
Definition: core.h:1256
typename Context::char_type char_type
Definition: core.h:1240
monostate no_value
Definition: core.h:1243
constexpr FMT_INLINE value(char_type val)
Definition: core.h:1272
const void * pointer
Definition: core.h:1255
unsigned uint_value
Definition: core.h:1245
FMT_CONSTEXPR FMT_INLINE value(basic_string_view< char_type > val)
Definition: core.h:1277
constexpr FMT_INLINE value(bool val)
Definition: core.h:1271
long long long_long_value
Definition: core.h:1246
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:256
#define FMT_ASSERT(condition, message)
Definition: core.h:336
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:2786
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:1665
#define FMT_END_EXPORT
Definition: core.h:185
#define FMT_ENUM_UNDERLYING_TYPE(type)
Definition: core.h:1980
std::integral_constant< bool, B > bool_constant
Definition: core.h:259
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:2853
#define FMT_CONSTEVAL
Definition: core.h:230
basic_string_view< char > string_view
Definition: core.h:501
#define FMT_UNICODE
Definition: core.h:216
align::type align_t
Definition: core.h:1986
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:1841
typename std::remove_const< T >::type remove_const_t
Definition: core.h:263
#define FMT_NODISCARD
Definition: core.h:154
typename std::remove_reference< T >::type remove_reference_t
Definition: core.h:261
typename detail::char_t_impl< S >::type char_t
String's character type.
Definition: core.h:646
buffer_context< char > format_context
Definition: core.h:1759
FMT_API void vprint(string_view fmt, format_args args)
Definition: format-inl.h:1463
auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
Definition: core.h:2828
#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:2874
#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:1077
#define FMT_BEGIN_NAMESPACE
Definition: core.h:174
auto runtime(string_view s) -> runtime_format_string<>
\rst Creates a runtime format string.
Definition: core.h:2769
#define FMT_API
Definition: core.h:202
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:1824
#define FMT_ENABLE_IF(...)
Definition: core.h:286
#define FMT_BEGIN_EXPORT
Definition: core.h:184
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:2846
#define FMT_CONSTEXPR_CHAR_TRAITS
Definition: core.h:129
#define FMT_INLINE
Definition: core.h:162
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:2902
basic_format_args< format_context > format_args
An alias to basic_format_args<format_context>.
Definition: core.h:1971
#define FMT_NORETURN
Definition: core.h:147
#define FMT_MSC_WARNING(...)
Definition: core.h:58
typename type_identity< T >::type type_identity_t
Definition: core.h:267
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:2814
typename std::conditional< B, T, F >::type conditional_t
Definition: core.h:258
#define FMT_CONSTEXPR20
Definition: core.h:113
sign::type sign_t
Definition: core.h:1990
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
Definition: core.h:265
typename std::underlying_type< T >::type underlying_t
Definition: core.h:269
presentation_type
Definition: core.h:2019
#define FMT_END_NAMESPACE
Definition: core.h:177
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:1764
#define FMT_EXPORT
Definition: core.h:183
detail namespace with internal helper functions
Definition: xchar.h:20
FMT_CONSTEXPR auto code_point_length(const Char *begin) -> int
Definition: core.h:2112
constexpr auto to_ascii(Char c) -> char
Definition: core.h:2102
void void_t
Definition: core.h:1510
FMT_CONSTEXPR auto check_char_specs(const format_specs< Char > &specs) -> bool
Definition: core.h:2558
FMT_CONSTEXPR void ignore_unused(const T &...)
Definition: core.h:302
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
Definition: core.h:1117
uint128_opt
Definition: core.h:367
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
Definition: chrono.h:419
conditional_t< long_short, unsigned, unsigned long long > ulong_type
Definition: core.h:1316
FMT_CONSTEXPR auto parse_nonnegative_int(const Char *&begin, const Char *end, int error_value) noexcept -> int
Definition: core.h:2138
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:2237
constexpr auto digits10() noexcept -> int
Definition: format.h:1283
void init_named_args(named_arg_info< Char > *, int, int)
Definition: core.h:1176
FMT_CONSTEXPR counting_iterator copy_str(InputIt begin, InputIt end, counting_iterator it)
Definition: compile.h:17
FMT_CONSTEXPR auto parse_replacement_field(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2441
@ has_named_args_bit
Definition: core.h:1485
FMT_INLINE auto to_string_view(const Char *s) -> basic_string_view< Char >
Definition: core.h:517
int128_opt
Definition: core.h:366
FMT_CONSTEXPR auto do_parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2177
auto convert_for_visit(T) -> monostate
Definition: core.h:369
FMT_FUNC void print(std::FILE *f, string_view text)
Definition: format-inl.h:1452
constexpr auto is_name_start(Char c) -> bool
Definition: core.h:2172
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:1096
constexpr auto in(type t, int set) -> bool
Definition: core.h:611
@ bool_set
Definition: core.h:621
@ uint_set
Definition: core.h:619
@ pointer_set
Definition: core.h:627
@ float_set
Definition: core.h:623
@ cstring_set
Definition: core.h:626
@ char_set
Definition: core.h:622
@ sint_set
Definition: core.h:617
@ string_set
Definition: core.h:625
FMT_CONSTEXPR FMT_INLINE void parse_format_string(basic_string_view< Char > format_str, Handler &&handler)
Definition: core.h:2478
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:3934
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2120
@ is_unpacked_bit
Definition: core.h:1484
FMT_CONSTEXPR auto is_utf8() -> bool
Definition: core.h:380
constexpr bool is_integral_type(type t)
Definition: core.h:603
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
Definition: core.h:2679
@ error
throw a parse_error exception in case of a tag
const T & first(const T &value, const Tail &...)
Definition: compile.h:60
typename format_as_result< T >::type format_as_t
Definition: core.h:1326
FMT_CONSTEXPR FMT_INLINE auto make_arg(T &val) -> value< Context >
Definition: core.h:1558
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:1208
auto get_container(std::back_insert_iterator< Container > it) -> Container &
Definition: core.h:765
constexpr Char sign(Sign s)
Definition: format.h:1172
constexpr auto has_const_formatter() -> bool
Definition: core.h:1107
@ packed_arg_bits
Definition: core.h:1481
constexpr auto count() -> size_t
Definition: core.h:1203
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T > > > buffer_appender
Definition: core.h:1113
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:2649
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2206
FMT_INLINE auto get_iterator(Buf &buf, OutputIt) -> decltype(buf.out())
Definition: core.h:1127
constexpr auto count_statically_named_args() -> size_t
Definition: core.h:1213
constexpr auto set(type rhs) -> int
Definition: core.h:610
constexpr bool is_arithmetic_type(type t)
Definition: core.h:606
@ long_short
Definition: core.h:1314
arg_id_kind
Definition: core.h:2064
state
Definition: core.h:2271
constexpr auto count() -> size_t
Definition: core.h:1204
void vformat_to(buffer< Char > &buf, const text_style &ts, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char > > > args)
Definition: color.h:436
type
Definition: core.h:556
constexpr FMT_INLINE auto const_check(T value) -> T
Definition: core.h:323
conditional_t< long_short, int, long long > long_type
Definition: core.h:1315
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view< Char > name) -> int
Definition: core.h:2583
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
Definition: core.h:374
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:2275
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:2259
@ max_packed_args
Definition: core.h:1483
constexpr FMT_INLINE auto is_constant_evaluated(bool default_value=false) noexcept -> bool
Definition: core.h:304
FMT_CONSTEXPR auto parse_align(const Char *begin, const Char *end, format_specs< Char > &specs) -> const Char *
Definition: format.h:2399
constexpr auto encode_types() -> unsigned long long
Definition: core.h:1542
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:2128
constexpr auto format_as(Enum e) noexcept -> underlying_t< Enum >
Definition: format.h:4129
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:3417
constexpr const char * name(const T &)
FMT_CONSTEXPR FMT_INLINE auto args() const -> const T *
Definition: core.h:1169
FMT_CONSTEXPR FMT_INLINE arg_data(const U &... init)
Definition: core.h:1168
FMT_CONSTEXPR FMT_INLINE auto named_args() -> std::nullptr_t
Definition: core.h:1170
T args_[1+(NUM_ARGS !=0 ? NUM_ARGS :+1)]
Definition: core.h:1152
named_arg_info< Char > named_args_[NUM_NAMED_ARGS]
Definition: core.h:1153
auto args() const -> const T *
Definition: core.h:1158
arg_data(const arg_data &other)=delete
arg_data(const U &... init)
Definition: core.h:1156
auto named_args() -> named_arg_info< Char > *
Definition: core.h:1159
FMT_CONSTEXPR FMT_INLINE auto map(const char_type *val) -> const char_type *
Definition: core.h:1391
FMT_CONSTEXPR FMT_INLINE auto map(void *val) -> const void *
Definition: core.h:1408
FMT_CONSTEXPR FMT_INLINE auto map(long val) -> long_type
Definition: core.h:1348
FMT_CONSTEXPR FMT_INLINE auto map(uint128_opt val) -> uint128_opt
Definition: core.h:1360
FMT_CONSTEXPR FMT_INLINE auto map(T val) -> char_type
Definition: core.h:1367
FMT_CONSTEXPR FMT_INLINE auto map(int val) -> int
Definition: core.h:1346
FMT_CONSTEXPR FMT_INLINE auto map(T &val) -> decltype(do_map(val))
Definition: core.h:1462
FMT_CONSTEXPR FMT_INLINE auto map(long double val) -> long double
Definition: core.h:1384
FMT_CONSTEXPR FMT_INLINE auto map(char_type *val) -> const char_type *
Definition: core.h:1388
FMT_CONSTEXPR FMT_INLINE auto map(bool val) -> bool
Definition: core.h:1363
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long long val) -> unsigned long long
Definition: core.h:1353
FMT_CONSTEXPR FMT_INLINE auto map(const T(&values)[N]) -> const T(&)[N]
Definition: core.h:1431
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long val) -> ulong_type
Definition: core.h:1349
FMT_CONSTEXPR FMT_INLINE auto map(short val) -> int
Definition: core.h:1342
FMT_CONSTEXPR FMT_INLINE auto map(std::nullptr_t val) -> const void *
Definition: core.h:1412
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> decltype(map(U()))
Definition: core.h:1438
auto map(...) -> unformattable
Definition: core.h:1472
FMT_CONSTEXPR FMT_INLINE auto map(const void *val) -> const void *
Definition: core.h:1409
FMT_CONSTEXPR FMT_INLINE auto map(int128_opt val) -> int128_opt
Definition: core.h:1357
FMT_CONSTEXPR FMT_INLINE auto map(float val) -> float
Definition: core.h:1382
FMT_CONSTEXPR FMT_INLINE auto do_map(T &) -> unformattable
Definition: core.h:1452
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char val) -> unsigned
Definition: core.h:1339
FMT_CONSTEXPR FMT_INLINE auto map(unsigned val) -> unsigned
Definition: core.h:1347
FMT_CONSTEXPR FMT_INLINE auto map(long long val) -> long long
Definition: core.h:1352
FMT_CONSTEXPR FMT_INLINE auto do_map(T &val) -> T &
Definition: core.h:1448
FMT_CONSTEXPR auto map(const T &) -> unformattable_pointer
Definition: core.h:1425
FMT_CONSTEXPR FMT_INLINE auto map(double val) -> double
Definition: core.h:1383
FMT_CONSTEXPR FMT_INLINE auto map(const T &) -> unformattable_char
Definition: core.h:1404
FMT_CONSTEXPR FMT_INLINE auto map(signed char val) -> int
Definition: core.h:1338
typename Context::char_type char_type
Definition: core.h:1336
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> basic_string_view< char_type >
Definition: core.h:1397
FMT_CONSTEXPR FMT_INLINE auto map(T) -> unformattable_char
Definition: core.h:1378
FMT_CONSTEXPR FMT_INLINE auto map(unsigned short val) -> unsigned
Definition: core.h:1343
FMT_CONSTEXPR FMT_INLINE auto map(const T &named_arg) -> decltype(map(named_arg.value))
Definition: core.h:1467
arg_id_kind kind
Definition: core.h:2081
FMT_CONSTEXPR arg_ref(basic_string_view< Char > name)
Definition: core.h:2072
FMT_CONSTEXPR arg_ref()
Definition: core.h:2068
FMT_CONSTEXPR auto operator=(int idx) -> arg_ref &
Definition: core.h:2075
FMT_CONSTEXPR arg_ref(int index)
Definition: core.h:2070
union detail::arg_ref::value val
auto limit(size_t size) -> size_t
Definition: core.h:885
auto count() const -> size_t
Definition: core.h:884
buffer_traits(size_t)
Definition: core.h:883
decltype(to_string_view(std::declval< S >())) result
Definition: core.h:552
typename result::value_type type
Definition: core.h:553
typename Context::parse_context_type parse_context
Definition: core.h:1232
void(* format)(void *arg, parse_context &parse_ctx, Context &ctx)
Definition: core.h:1234
void * value
Definition: core.h:1233
Definition: format.h:1762
arg_ref< Char > & ref
Definition: core.h:2217
FMT_CONSTEXPR void on_name(basic_string_view< Char > id)
Definition: core.h:2229
FMT_CONSTEXPR void on_auto()
Definition: core.h:2219
FMT_CONSTEXPR void on_index(int id)
Definition: core.h:2224
basic_format_parse_context< Char > & ctx
Definition: core.h:2216
constexpr error_handler()=default
FMT_NORETURN void on_error(const char *message)
Definition: core.h:636
FMT_CONSTEXPR void operator=(basic_string_view< Char > s)
Definition: core.h:2002
constexpr auto data() const -> const Char *
Definition: core.h:2010
FMT_CONSTEXPR auto operator[](size_t index) const -> const Char &
Definition: core.h:2013
FMT_CONSTEXPR auto operator[](size_t index) -> Char &
Definition: core.h:2012
constexpr auto size() const -> size_t
Definition: core.h:2009
int id
Definition: core.h:1145
const Char * name
Definition: core.h:1144
const named_arg_info< Char > * data
Definition: core.h:1227
size_t size
Definition: core.h:1228
const T & value
Definition: core.h:1139
const Char * name
Definition: core.h:1138
named_arg(const Char *n, const T &v)
Definition: core.h:1140
const Char * data
Definition: core.h:1222
size_t size
Definition: core.h:1223
remove_cvref_t< decltype(T::value)> type
Definition: core.h:2531
T type
Definition: core.h:2528
Specifies if T is a character type.
Definition: core.h:505
constexpr monostate()
Definition: core.h:277
T type
Definition: core.h:266
basic_string_view< Char > name
Definition: core.h:2087
int index
Definition: core.h:2086
FMT_CONSTEXPR value(int idx=0)
Definition: core.h:2083
FMT_CONSTEXPR value(basic_string_view< Char > n)
Definition: core.h:2084
#define S(label, offset, message)
Definition: Errors.h:119