Go to the documentation of this file.
18 #include <type_traits>
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
36 #ifndef FMT_GCC_PRAGMA
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
102 #if FMT_USE_CONSTEXPR
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 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
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]]
150 # define FMT_NORETURN
153 #ifndef FMT_NODISCARD
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 // Mark iterator as checked.
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
224 #ifndef FMT_CONSTEVAL
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__) && \
270 template <
bool B,
typename T =
void>
272 template <
bool B,
typename T,
typename F>
275 template <
typename T>
277 template <
typename T>
279 template <
typename T>
285 template <
typename T>
290 template <
typename Char>
301 # define FMT_ENABLE_IF(...)
303 # define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0
308 #ifdef __cpp_lib_byte
309 template <
typename T, FMT_ENABLE_IF(std::is_same<T, std::
byte>::value)>
310 inline auto format_as(T b) ->
unsigned char {
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)
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)
361 template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
362 #elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
363 template <
typename Char>
364 using std_string_view = std::experimental::basic_string_view<Char>;
369 #ifdef FMT_USE_INT128
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
390 template <
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;
403 uchar(section[1]) == 0xA7);
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
457 constexpr
auto data() const noexcept -> const Char* {
return data_; }
460 constexpr
auto size() const noexcept ->
size_t {
return 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;
530 template <
typename S>
533 template <
typename Char, FMT_ENABLE_IF(is_
char<Char>::value)>
537 template <
typename Char,
typename Traits,
typename Alloc>
542 template <
typename Char>
547 template <
typename Char,
552 template <
typename S, FMT_ENABLE_IF(is_compile_
string<S>::value)>
563 template <
typename S>
565 : std::is_class<decltype(detail::to_string_view(std::declval<S>()))> {};
570 using type =
typename result::value_type;
597 template <
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> {}
627 constexpr
auto set(
type rhs) ->
int {
return 1 <<
static_cast<int>(rhs); }
629 return ((
set >>
static_cast<int>(t)) & 1) != 0;
714 "cannot switch from manual to automatic argument indexing");
729 "cannot switch from automatic to manual argument indexing");
744 template <
typename Char>
774 #if !defined(__LCC__)
782 template <
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;
793 template <
typename Char,
typename InputIt,
typename OutputIt>
796 while (begin != end) *out++ =
static_cast<Char
>(*begin++);
800 template <
typename Char,
typename T,
typename U,
806 if (
size > 0) memcpy(out, begin,
size *
sizeof(U));
857 constexpr
auto size() const noexcept ->
size_t {
return size_; }
895 template <
typename Idx>
903 auto count() const ->
size_t {
return 0; }
923 template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
955 template <
typename T>
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(); }
1012 template <
typename Container>
1015 typename Container::value_type>>
1016 final :
public buffer<typename Container::value_type> {
1032 auto out() -> std::back_insert_iterator<Container> {
1033 return std::back_inserter(container_);
1047 count_ += this->
size();
1058 template <
typename Char>
1065 if (
id >=
static_cast<context*
>(
this)->num_args())
1070 template <
typename Char>
1076 static_cast<context*
>(
this)->check_dynamic_spec(arg_id);
1086 template <
typename T,
typename Char =
char,
typename Enable =
void>
1094 template <
typename T,
typename Context>
1096 std::is_constructible<typename Context::template formatter_type<T>>;
1100 class appender :
public std::back_insert_iterator<detail::buffer<char>> {
1101 using base = std::back_insert_iterator<detail::buffer<char>>;
1104 using std::back_insert_iterator<detail::buffer<char>>::back_insert_iterator;
1114 template <
typename Context,
typename T>
1116 -> decltype(
typename Context::template formatter_type<T>().
format(
1117 std::declval<const T&>(), std::declval<Context&>()),
1121 template <
typename Context>
1125 template <
typename T,
typename Context>
1127 return has_const_formatter_impl<Context>(
static_cast<T*
>(
nullptr));
1130 template <
typename T>
1132 std::back_insert_iterator<buffer<T>>>;
1135 template <
typename T,
typename OutputIt>
1139 template <
typename T,
typename Buf,
1145 template <
typename Buf,
typename OutputIt>
1149 template <
typename T,
typename OutputIt>
1167 template <
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>
1181 template <
typename T,
typename Char,
size_t NUM_ARGS>
1186 template <
typename... U>
1194 template <
typename Char>
1200 template <
typename T,
typename Char>
1203 template <
typename Char,
typename T,
typename... Tail,
1206 int named_arg_count,
const T&,
const Tail&...
args) {
1210 template <
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};
1218 template <
typename... Args>
1222 template <
bool B = false> constexpr
auto count() ->
size_t {
return B ? 1 : 0; }
1223 template <
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...>();
1231 template <
typename... Args>
1233 return count<is_statically_named_arg<Args>::value...>();
1257 template <
typename Context>
class value {
1297 string.data = val.
data();
1298 string.size = val.
size();
1306 custom.value =
const_cast<value_type*
>(std::addressof(val));
1311 value_type,
typename Context::template formatter_type<value_type>>;
1319 template <
typename T,
typename Formatter>
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)));
1348 template <
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 ||
1391 #ifdef __cpp_
char8_t
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))>
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)>
1498 template <
typename T,
typename Context>
1500 type_constant<decltype(arg_mapper<Context>().map(std::declval<const T&>())),
1501 typename Context::char_type>;
1509 template <
typename Char,
typename InputIt>
1514 template <
typename Char,
typename InputIt>
1516 std::back_insert_iterator<std::string> out)
1517 -> std::back_insert_iterator<std::string> {
1522 template <
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
1529 template <
typename...>
struct void_t_impl {
1532 template <
typename... T>
using void_t =
typename void_t_impl<T...>
::type;
1537 template <
typename It,
typename T,
typename Enable =
void>
1540 template <
typename It,
typename T>
1544 decltype(*std::declval<It>() = std::declval<T>())>>
1548 template <
typename Container>
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;
1570 template <
typename Context,
typename Arg,
typename... Args>
1576 #if defined(__cpp_if_constexpr)
1578 template <
typename T,
typename Char>
struct type_is_unformattable_for;
1581 template <
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");
1610 template <
typename Context,
typename T>
1614 arg.value_ = make_arg<true, Context>(val);
1618 template <
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));
1646 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
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);
1697 template <
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); }
1790 template <
typename Char>
1795 template <
typename T,
typename Char =
char>
1798 .
map(std::declval<T&>()))>::value>;
1807 template <
typename Context,
typename... Args>
1828 static constexpr
unsigned long long desc =
1831 (num_named_args != 0
1836 template <
typename... T>
1842 data_{detail::make_arg<is_packed, Context>(
args)...} {
1874 template <
typename Char,
typename T>
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
2037 auto size =
s.size();
2039 for (
size_t i = 0; i <
size; ++i)
data_[i] =
s[i];
2040 size_ =
static_cast<unsigned char>(
size);
2044 constexpr
auto data() const -> const Char* {
return data_; }
2048 return data_[index];
2128 template <
typename Char =
char>
2135 template <
typename Char, FMT_ENABLE_IF(std::is_
integral<Char>::value)>
2137 return c <= 0xff ? static_cast<char>(c) :
'\0';
2139 template <
typename Char, FMT_ENABLE_IF(std::is_enum<Char>::value)>
2140 constexpr
auto to_ascii(Char c) ->
char {
2141 return c <= 0xff ? static_cast<char>(c) :
'\0';
2145 template <
typename Char>
2148 auto c =
static_cast<unsigned char>(*begin);
2149 return static_cast<int>((0x3a55000000000000ull >> (2 * (c >> 3))) & 0x3) + 1;
2153 template <
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;
2171 template <
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);
2187 const unsigned max =
to_unsigned((std::numeric_limits<int>::max)());
2189 prev * 10ull + unsigned(p[-1] -
'0') <= max
2190 ?
static_cast<int>(
value)
2201 return align::center;
2207 return (
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z') || c ==
'_';
2210 template <
typename Char,
typename Handler>
2212 Handler&& handler) ->
const Char* {
2214 if (c >=
'0' && c <=
'9') {
2216 constexpr
int max = (std::numeric_limits<int>::max)();
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)});
2239 template <
typename Char,
typename Handler>
2241 Handler&& handler) ->
const Char* {
2244 if (c !=
'}' && c !=
':')
return do_parse_arg_id(begin, end, handler);
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);
2270 template <
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;
2292 template <
typename Char>
2298 if (begin == end || *begin ==
'}') {
2308 template <
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;
2485 template <
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;
2522 template <
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);
2546 FMT_CONSTEXPR void operator()(
const Char* from,
const Char* to) {
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);
2579 template <
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> _;
2602 template <
typename Char>
2609 if (specs.align == align::numeric || specs.sign != sign::none || specs.alt)
2614 #if FMT_USE_NONTYPE_TEMPLATE_ARGS
2615 template <
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)
2627 template <
typename... Args,
typename Char>
2629 #if FMT_USE_NONTYPE_TEMPLATE_ARGS
2630 if constexpr (
sizeof...(Args) > 0)
2656 parse_funcs_{&parse_format_specs<Args, parse_context_type>...} {}
2665 #if FMT_USE_NONTYPE_TEMPLATE_ARGS
2667 if (index < 0)
on_error(
"named argument is not found");
2671 on_error(
"compile-time checks for named arguments require C++20 support");
2693 template <
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 "
2701 template <
typename... Args,
typename S,
2704 using char_t =
typename S::char_type;
2707 FMT_CONSTEXPR bool error = (parse_format_string<true>(
s, checker(
s)),
true);
2720 template <
typename Char>
2733 template <
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,
2780 std::is_reference<Args>::value)...>() == 0,
2781 "passing views as lvalues is disallowed");
2782 #ifdef FMT_HAS_CONSTEVAL
2783 if constexpr (detail::count_named_args<Args...>() ==
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
2804 template <
typename... Args>
2832 template <
typename... T>
2839 template <
typename OutputIt,
2842 auto&& buf = detail::get_buffer<char>(out);
2859 template <
typename OutputIt,
typename... T,
2873 template <
typename OutputIt,
typename... T,
2880 return {buf.out(), buf.count()};
2891 template <
typename OutputIt,
typename... T,
2899 template <
typename... T>
2901 T&&...
args) ->
size_t {
2920 template <
typename... T>
2937 template <
typename... T>
2948 template <
typename... T>
2957 template <
typename... T>
2966 #ifdef FMT_HEADER_ONLY
2969 #endif // FMT_CORE_H_
FMT_CONSTEXPR basic_string_view(S s) noexcept
auto operator++() noexcept -> appender &
auto count() const -> size_t
FMT_CONSTEXPR void ignore_unused(const T &...)
void init_named_args(named_arg_info< Char > *, int, int)
constexpr FMT_INLINE value(bool val)
constexpr auto arg(int id) const -> format_arg
FMT_CONSTEXPR FMT_INLINE auto map(int val) -> int
constexpr error_handler()=default
FMT_CONSTEXPR FMT_INLINE arg_data(const U &... init)
named_arg(const Char *n, const T &v)
FMT_INLINE auto to_string_view(const Char *s) -> basic_string_view< Char >
constexpr auto operator[](size_t pos) const noexcept -> const Char &
FMT_CONSTEXPR auto operator[](size_t index) const -> const Char &
constexpr auto data() const noexcept -> const Char *
auto first(const T &value, const Tail &...) -> const T &
auto args() const -> const T *
FMT_INLINE value(uint128_opt val)
auto count() const -> size_t
void advance_to(iterator it)
const named_arg_info< Char > * data
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR auto next_arg_id() -> int
FMT_CONSTEXPR FMT_INLINE auto make_arg(T &val) -> value< Context >
basic_string_view< Char > name
FMT_CONSTEXPR FMT_INLINE auto do_map(T &) -> unformattable
basic_format_args< format_context > format_args
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 *
constexpr auto encode_types() -> unsigned long long
iterator_buffer(iterator_buffer &&other)
FMT_CONSTEXPR FMT_INLINE auto map(T) -> unformattable_char
FMT_CONSTEXPR auto arg_id(basic_string_view< Char > name) -> int
FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
#define FMT_MSC_WARNING(...)
FMT_CONSTEXPR20 void grow(size_t) override
constexpr auto size() const noexcept -> size_t
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char val) -> unsigned
FMT_CONSTEXPR20 void push_back(const T &value)
span_CONFIG_SIZE_TYPE size_t
auto get() const -> Locale
FMT_CONSTEXPR auto operator[](size_t index) -> Char &
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
FMT_CONSTEXPR arg_ref(int index)
static void format_custom_arg(void *arg, typename Context::parse_context_type &parse_ctx, Context &ctx)
std::back_insert_iterator< detail::buffer< char > > base
FMT_CONSTEXPR void operator=(basic_string_view< Char > s)
FMT_INLINE auto end() noexcept -> T *
std::is_constructible< typename Context::template formatter_type< T > > has_formatter
FMT_CONSTEXPR void advance_to(iterator it)
FMT_CONSTEXPR FMT_INLINE auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
constexpr auto size() const noexcept -> size_t
FMT_NORETURN void on_error(const char *message)
FMT_CONSTEXPR_CHAR_TRAITS auto starts_with(const Char *s) const -> bool
constexpr auto end() const noexcept -> iterator
typename std::remove_const< T >::type remove_const_t
FMT_CONSTEXPR FMT_INLINE auto map(void *val) -> const void *
FMT_CONSTEXPR FMT_INLINE auto args() const -> const T *
constexpr auto data() const -> const Char *
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
remove_cvref_t< decltype(T::value)> type
uint128_opt uint128_value
basic_format_args< basic_format_context > args_
bool_constant<!std::is_base_of< detail::unformattable, decltype(detail::arg_mapper< buffer_context< Char > >() .map(std::declval< T & >()))>::value > is_formattable
constexpr auto size() const -> size_t
FMT_CONSTEXPR20 ~buffer()=default
FMT_CONSTEXPR FMT_INLINE value(const char_type *val)
FMT_CONSTEXPR auto parse_replacement_field(const Char *begin, const Char *end, Handler &&handler) -> const Char *
FMT_CONSTEXPR void on_auto()
void on_error(const char *message)
FMT_CONSTEXPR FMT_INLINE auto map(std::nullptr_t val) -> const void *
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
constexpr FMT_INLINE locale_ref()
FMT_FUNC void print(std::FILE *f, string_view text)
named_arg_info< Char > named_args_[NUM_NAMED_ARGS]
union detail::arg_ref::value val
FMT_CONSTEXPR FMT_INLINE void parse_format_string(basic_string_view< Char > format_str, Handler &&handler)
integral_constant< bool, false > false_type
static int writer(lua_State *L, const void *b, size_t size, void *ud)
FMT_CONSTEXPR void check_arg_id(int id)
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
virtual FMT_CONSTEXPR20 void grow(size_t capacity)=0
constexpr auto capacity() const noexcept -> size_t
constexpr auto is_name_start(Char c) -> bool
constexpr auto has_const_formatter_impl(T *) -> decltype(typename Context::template formatter_type< T >().format(std::declval< const T & >(), std::declval< Context & >()), true)
FMT_INLINE auto end() const noexcept -> const T *
FMT_INLINE auto format_to(OutputIt out, format_string< T... > fmt, T &&... args) -> OutputIt
FMT_CONSTEXPR FMT_INLINE auto map(T val) -> char_type
named_arg_value< char_type > named_args
conditional_t< long_short, unsigned, unsigned long long > ulong_type
FMT_CONSTEXPR void on_index(int id)
FMT_CONSTEXPR auto map(const T &) -> unformattable_pointer
constexpr auto in(type t, int set) -> bool
constexpr FMT_INLINE value(double val)
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
constexpr FMT_INLINE value(char_type val)
integral_constant< bool, true > true_type
FMT_CONSTEXPR FMT_INLINE auto map(const void *val) -> const void *
constexpr auto is_integral_type(type t) -> bool
FMT_CONSTEXPR_CHAR_TRAITS FMT_INLINE basic_string_view(const Char *s)
constexpr FMT_INLINE value(unsigned long long val)
#define FMT_GCC_PRAGMA(arg)
FMT_CONSTEXPR basic_string_view(const std::basic_string< Char, Traits, Alloc > &s) noexcept
FMT_CONSTEXPR value(basic_string_view< Char > n)
FMT_INLINE void println(std::FILE *f, format_string< T... > fmt, T &&... args)
FMT_INLINE auto get_iterator(Buf &buf, OutputIt) -> decltype(buf.out())
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> basic_string_view< char_type >
FMT_CONSTEXPR auto locale() -> detail::locale_ref
FMT_INLINE void check_format_string(const S &)
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T > >> buffer_appender
FMT_CONSTEXPR auto parse_nonnegative_int(const Char *&begin, const Char *end, int error_value) noexcept -> int
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view< Char > name) -> int
void append(const U *begin, const U *end)
FMT_CONSTEXPR auto check_char_specs(const format_specs< Char > &specs) -> bool
auto operator++(int) noexcept -> appender
auto count() const -> size_t
FMT_CONSTEXPR FMT_INLINE auto map(unsigned val) -> unsigned
FMT_CONSTEXPR auto parse_align(char c) -> align_t
auto runtime(string_view s) -> runtime_format_string<>
constexpr auto begin() const noexcept -> iterator
typename std::underlying_type< T >::type underlying_t
FMT_CONSTEXPR auto data() noexcept -> T *
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR void remove_prefix(size_t n) noexcept
FMT_CONSTEXPR FMT_INLINE auto map(char_type *val) -> const char_type *
span_constexpr std::size_t size(span< T, Extent > const &spn)
FMT_CONSTEXPR FMT_INLINE auto map(signed char val) -> int
buffer_context< char > format_context
constexpr auto count() -> size_t
const char & const_reference
#define FMT_ENABLE_IF(...)
typename Context::char_type char_type
FMT_CONSTEXPR FMT_INLINE auto named_args() -> std::nullptr_t
iterator_buffer(Container &c)
FMT_CONSTEXPR auto out() -> iterator
void clear(lua_State *L, int table_index)
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 *
constexpr FMT_INLINE value(float val)
FMT_CONSTEXPR arg_ref(basic_string_view< Char > name)
#define FMT_DECLTYPE_THIS
custom_value< Context > custom
typename format_as_result< T >::type format_as_t
FMT_CONSTEXPR auto operator=(int idx) -> arg_ref &
string_value< char_type > string
#define FMT_END_NAMESPACE
constexpr auto format_as(Enum e) noexcept -> underlying_t< Enum >
conditional_t< long_short, int, long long > long_type
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
constexpr basic_format_context(OutputIt out, format_args ctx_args, detail::locale_ref loc={})
iterator_buffer(T *out, size_t=0)
const T & move(const T &v)
fixed_buffer_traits(size_t limit)
FMT_CONSTEXPR FMT_INLINE value(basic_string_view< char_type > val)
auto limit(size_t size) -> size_t
long long long_long_value
typename result::value_type type
FMT_CONSTEXPR FMT_INLINE auto map(unsigned short val) -> unsigned
constexpr auto has_const_formatter() -> bool
constexpr FMT_INLINE value(long long val)
void operator=(const buffer &)=delete
constexpr auto make_format_args(T &... args) -> format_arg_store< Context, remove_cvref_t< T >... >
constexpr auto arg_type(int id) const -> type
constexpr basic_string_view() noexcept
FMT_CONSTEXPR20 void grow(size_t) override
typename std::enable_if< B, T >::type enable_if_t
FMT_CONSTEXPR FMT_INLINE auto map(const T &) -> unformattable_char
FMT_CONSTEXPR20 void grow(size_t) override
FMT_CONSTEXPR auto copy_str(InputIt begin, InputIt end, counting_iterator it) -> counting_iterator
FMT_CONSTEXPR compile_parse_context(basic_string_view< Char > format_str, int num_args, const type *types, int next_arg_id=0)
FMT_CONSTEXPR_CHAR_TRAITS auto starts_with(basic_string_view< Char > sv) const noexcept -> bool
typename type_identity< T >::type type_identity_t
constexpr FMT_INLINE value(unsigned val)
iterator_buffer(OutputIt out, size_t n=buffer_size)
constexpr auto set(type rhs) -> int
FMT_CONSTEXPR value(int idx=0)
auto convert_for_visit(T) -> monostate
FMT_INLINE value(int128_opt val)
#define FMT_CONSTEXPR_CHAR_TRAITS
FMT_CONSTEXPR auto next_arg_id() -> int
auto count() const -> size_t
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
typename basic_format_context ::parse_context_type parse_context
T args_[1+(NUM_ARGS !=0 ? NUM_ARGS :+1)]
FMT_CONSTEXPR FMT_INLINE auto map(long val) -> long_type
FMT_CONSTEXPR void on_name(basic_string_view< Char > id)
constexpr auto digits10() noexcept -> int
auto find< false, char >(const char *first, const char *last, char value, const char *&out) -> bool
FMT_CONSTEXPR FMT_INLINE auto do_map(T &val) -> T &
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> decltype(FMT_DECLTYPE_THIS map(U()))
appender(base it) noexcept
FMT_CONSTEXPR20 buffer(T *p=nullptr, size_t sz=0, size_t cap=0) noexcept
auto limit(size_t size) -> size_t
FMT_CONSTEXPR20 void grow(size_t) override
basic_string_view< char > string_view
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR void do_check_arg_id(int id)
FMT_CONSTEXPR auto operator[](Idx index) const -> const T &
FMT_CONSTEXPR FMT_INLINE auto map(double val) -> double
FMT_CONSTEXPR20 void try_resize(size_t count)
auto vformat(const Locale &loc, basic_string_view< Char > fmt, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> std::basic_string< Char >
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
FMT_NODISCARD FMT_INLINE auto format(format_string< T... > fmt, T &&... args) -> std::string
FMT_CONSTEXPR auto data() const noexcept -> const T *
FMT_CONSTEXPR FMT_INLINE auto map(const T(&values)[N]) -> const T(&)[N]
auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
FMT_CONSTEXPR void check_arg_id(int id)
constexpr FMT_INLINE auto is_constant_evaluated(bool default_value=false) noexcept -> bool
iterator_buffer(T *out, size_t n=buffer_size)
constexpr auto count_statically_named_args() -> size_t
#define FMT_ASSERT(condition, message)
basic_format_parse_context< Char > & ctx
FMT_INLINE value(const void *val)
constexpr auto num_args() const -> int
FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string< T... > fmt, T &&... args) -> format_to_n_result< OutputIt >
FMT_INLINE value(long double val)
constexpr auto is_arithmetic_type(type t) -> bool
auto args() const -> const format_args &
constexpr FMT_INLINE value()
std::integral_constant< bool, B > bool_constant
constexpr FMT_INLINE value(int val)
FMT_CONSTEXPR auto operator[](Idx index) -> T &
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
auto named_args() -> named_arg_info< Char > *
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long long val) -> unsigned long long
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 *
FMT_CONSTEXPR_CHAR_TRAITS auto starts_with(Char c) const noexcept -> bool
void(* format)(void *arg, parse_context &parse_ctx, Context &ctx)
FMT_CONSTEXPR20 void try_reserve(size_t new_capacity)
FMT_CONSTEXPR FMT_INLINE auto map(long long val) -> long long
FMT_CONSTEXPR FMT_INLINE auto map(bool val) -> bool
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)
FMT_CONSTEXPR_CHAR_TRAITS friend auto operator==(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR FMT_INLINE auto map(T &val) -> decltype(FMT_DECLTYPE_THIS do_map(val))
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
FMT_CONSTEXPR auto code_point_length(const Char *begin) -> int
FMT_UNCHECKED_ITERATOR(appender)
FMT_INLINE auto begin() noexcept -> T *
type_constant< decltype(arg_mapper< Context >().map(std::declval< const T & >())), typename Context::char_type > mapped_type_constant
typename basic_format_context ::char_type char_type
#define FMT_BEGIN_NAMESPACE
constexpr auto count() -> size_t
void init(const M_string &remappings)
FMT_API void vprint(string_view fmt, format_args args)
auto get_container(std::back_insert_iterator< Container > it) -> Container &
constexpr basic_string_view(const Char *s, size_t count) noexcept
constexpr basic_format_parse_context(basic_string_view< Char > format_str, int next_arg_id=0)
FMT_CONSTEXPR FMT_INLINE auto map(const T &named_arg) -> decltype(FMT_DECLTYPE_THIS map(named_arg.value))
constexpr auto end() const noexcept -> iterator
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
arg_data(const U &... init)
FMT_CONSTEXPR auto arg(basic_string_view< Char > name) -> format_arg
constexpr auto count_named_args() -> size_t
typename std::conditional< B, T, F >::type conditional_t
FMT_TYPE_CONSTANT(int, int_type)
auto map(...) -> unformattable
long double long_double_value
FMT_INLINE void print(format_string< T... > fmt, T &&... args)
#define FMT_ENUM_UNDERLYING_TYPE(type)
typename std::remove_reference< T >::type remove_reference_t
FMT_CONSTEXPR void set(T *buf_data, size_t buf_capacity) noexcept
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
iterator_buffer(iterator_buffer &&other)
FMT_CONSTEXPR auto is_utf8() -> bool
FMT_INLINE auto begin() const noexcept -> const T *
basic_string_view< Char > format_str_
FMT_CONSTEXPR FMT_INLINE auto map(uint128_opt val) -> uint128_opt
FMT_CONSTEXPR FMT_INLINE auto map(short val) -> int
auto out() -> std::back_insert_iterator< Container >
FMT_CONSTEXPR auto error_handler() -> detail::error_handler
FMT_NORETURN FMT_API void throw_format_error(const char *message)
constexpr auto begin() const noexcept -> iterator
FMT_CONSTEXPR20 FMT_INLINE value(T &val)
FMT_CONSTEXPR FMT_INLINE auto map(long double val) -> long double
typename detail::char_t_impl< S >::type char_t
FMT_CONSTEXPR FMT_INLINE auto map(float val) -> float
constexpr FMT_INLINE auto const_check(T value) -> T
FMT_CONSTEXPR FMT_INLINE auto map(const char_type *val) -> const char_type *
FMT_CONSTEXPR buffer(size_t sz) noexcept
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long val) -> ulong_type
FMT_NODISCARD FMT_INLINE auto formatted_size(format_string< T... > fmt, T &&... args) -> size_t
FMT_CONSTEXPR auto do_parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
unsigned long long ulong_long_value
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
FMT_CONSTEXPR20 void grow(size_t capacity) override
FMT_CONSTEXPR FMT_INLINE auto map(int128_opt val) -> int128_opt
constexpr auto to_ascii(Char c) -> char
decltype(to_string_view(std::declval< S >())) result
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:43