Agora
1.2.0
Agora project
|
Go to the documentation of this file.
17 #include <type_traits>
20 #define FMT_VERSION 80101
22 #if defined(__clang__) && !defined(__ibmxl__)
23 # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
25 # define FMT_CLANG_VERSION 0
28 #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && \
29 !defined(__NVCOMPILER)
30 # define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
32 # define FMT_GCC_VERSION 0
35 #ifndef FMT_GCC_PRAGMA
37 # if FMT_GCC_VERSION >= 504
38 # define FMT_GCC_PRAGMA(arg) _Pragma(arg)
40 # define FMT_GCC_PRAGMA(arg)
45 # define FMT_ICC_VERSION __ICL
46 #elif defined(__INTEL_COMPILER)
47 # define FMT_ICC_VERSION __INTEL_COMPILER
49 # define FMT_ICC_VERSION 0
53 # define FMT_NVCC __NVCC__
59 # define FMT_MSC_VER _MSC_VER
60 # define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
62 # define FMT_MSC_VER 0
63 # define FMT_MSC_WARNING(...)
67 # define FMT_HAS_FEATURE(x) __has_feature(x)
69 # define FMT_HAS_FEATURE(x) 0
72 #if defined(__has_include) && \
73 (!defined(__INTELLISENSE__) || FMT_MSC_VER > 1900) && \
74 (!FMT_ICC_VERSION || FMT_ICC_VERSION >= 1600)
75 # define FMT_HAS_INCLUDE(x) __has_include(x)
77 # define FMT_HAS_INCLUDE(x) 0
80 #ifdef __has_cpp_attribute
81 # define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
83 # define FMT_HAS_CPP_ATTRIBUTE(x) 0
87 # define FMT_CPLUSPLUS _MSVC_LANG
89 # define FMT_CPLUSPLUS __cplusplus
92 #define FMT_HAS_CPP14_ATTRIBUTE(attribute) \
93 (FMT_CPLUSPLUS >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))
95 #define FMT_HAS_CPP17_ATTRIBUTE(attribute) \
96 (FMT_CPLUSPLUS >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))
100 #ifndef FMT_USE_CONSTEXPR
101 # define FMT_USE_CONSTEXPR \
102 (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1912 || \
103 (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \
104 !FMT_NVCC && !FMT_ICC_VERSION
106 #if FMT_USE_CONSTEXPR
107 # define FMT_CONSTEXPR constexpr
108 # define FMT_CONSTEXPR_DECL constexpr
110 # define FMT_CONSTEXPR
111 # define FMT_CONSTEXPR_DECL
114 #if ((__cplusplus >= 202002L) && \
115 (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE > 9)) || \
116 (__cplusplus >= 201709L && FMT_GCC_VERSION >= 1002)
117 # define FMT_CONSTEXPR20 constexpr
119 # define FMT_CONSTEXPR20
123 #if defined(__GLIBCXX__)
124 # if __cplusplus >= 201703L && defined(_GLIBCXX_RELEASE) && \
125 _GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
126 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr
128 #elif defined(_LIBCPP_VERSION) && __cplusplus >= 201703L && \
129 _LIBCPP_VERSION >= 4000
130 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr
131 #elif FMT_MSC_VER >= 1914 && _MSVC_LANG >= 201703L
132 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr
134 #ifndef FMT_CONSTEXPR_CHAR_TRAITS
135 # define FMT_CONSTEXPR_CHAR_TRAITS
139 #ifndef FMT_EXCEPTIONS
140 # if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \
141 FMT_MSC_VER && !_HAS_EXCEPTIONS
142 # define FMT_EXCEPTIONS 0
144 # define FMT_EXCEPTIONS 1
149 #ifndef FMT_USE_NOEXCEPT
150 # define FMT_USE_NOEXCEPT 0
153 #if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
154 FMT_GCC_VERSION >= 408 || FMT_MSC_VER >= 1900
155 # define FMT_DETECTED_NOEXCEPT noexcept
156 # define FMT_HAS_CXX11_NOEXCEPT 1
158 # define FMT_DETECTED_NOEXCEPT throw()
159 # define FMT_HAS_CXX11_NOEXCEPT 0
163 # if FMT_EXCEPTIONS || FMT_HAS_CXX11_NOEXCEPT
164 # define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT
166 # define FMT_NOEXCEPT
172 #if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && \
174 # define FMT_NORETURN [[noreturn]]
176 # define FMT_NORETURN
179 #if __cplusplus == 201103L || __cplusplus == 201402L
180 # if defined(__INTEL_COMPILER) || defined(__PGI)
181 # define FMT_FALLTHROUGH
182 # elif defined(__clang__)
183 # define FMT_FALLTHROUGH [[clang::fallthrough]]
184 # elif FMT_GCC_VERSION >= 700 && \
185 (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 520)
186 # define FMT_FALLTHROUGH [[gnu::fallthrough]]
188 # define FMT_FALLTHROUGH
190 #elif FMT_HAS_CPP17_ATTRIBUTE(fallthrough)
191 # define FMT_FALLTHROUGH [[fallthrough]]
193 # define FMT_FALLTHROUGH
196 #ifndef FMT_NODISCARD
197 # if FMT_HAS_CPP17_ATTRIBUTE(nodiscard)
198 # define FMT_NODISCARD [[nodiscard]]
200 # define FMT_NODISCARD
204 #ifndef FMT_USE_FLOAT
205 # define FMT_USE_FLOAT 1
207 #ifndef FMT_USE_DOUBLE
208 # define FMT_USE_DOUBLE 1
210 #ifndef FMT_USE_LONG_DOUBLE
211 # define FMT_USE_LONG_DOUBLE 1
215 # if FMT_GCC_VERSION || FMT_CLANG_VERSION
216 # define FMT_INLINE inline __attribute__((always_inline))
218 # define FMT_INLINE inline
222 #ifndef FMT_DEPRECATED
223 # if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
224 # define FMT_DEPRECATED [[deprecated]]
226 # if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
227 # define FMT_DEPRECATED __attribute__((deprecated))
229 # define FMT_DEPRECATED __declspec(deprecated)
231 # define FMT_DEPRECATED
236 #ifndef FMT_BEGIN_NAMESPACE
237 # define FMT_BEGIN_NAMESPACE \
239 inline namespace v8 {
240 # define FMT_END_NAMESPACE \
245 #ifndef FMT_MODULE_EXPORT
246 # define FMT_MODULE_EXPORT
247 # define FMT_MODULE_EXPORT_BEGIN
248 # define FMT_MODULE_EXPORT_END
249 # define FMT_BEGIN_DETAIL_NAMESPACE namespace detail {
250 # define FMT_END_DETAIL_NAMESPACE }
253 #if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
254 # define FMT_CLASS_API FMT_MSC_WARNING(suppress : 4275)
256 # define FMT_API __declspec(dllexport)
257 # elif defined(FMT_SHARED)
258 # define FMT_API __declspec(dllimport)
261 # define FMT_CLASS_API
262 # if defined(FMT_EXPORT) || defined(FMT_SHARED)
263 # if defined(__GNUC__) || defined(__clang__)
264 # define FMT_API __attribute__((visibility("default")))
273 #if (FMT_HAS_INCLUDE(<string_view>) && \
274 (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \
275 (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910)
276 # include <string_view>
277 # define FMT_USE_STRING_VIEW
278 #elif FMT_HAS_INCLUDE("experimental/string_view") && __cplusplus >= 201402L
279 # include <experimental/string_view>
280 # define FMT_USE_EXPERIMENTAL_STRING_VIEW
284 # define FMT_UNICODE !FMT_MSC_VER
287 #ifndef FMT_CONSTEVAL
288 # if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
289 __cplusplus > 201703L && !defined(__apple_build_version__)) || \
290 (defined(__cpp_consteval) && \
291 (!FMT_MSC_VER || _MSC_FULL_VER >= 193030704))
293 # define FMT_CONSTEVAL consteval
294 # define FMT_HAS_CONSTEVAL
296 # define FMT_CONSTEVAL
300 #ifndef FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
301 # if defined(__cpp_nontype_template_args) && \
302 ((FMT_GCC_VERSION >= 903 && __cplusplus >= 201709L) || \
303 __cpp_nontype_template_args >= 201911L)
304 # define FMT_USE_NONTYPE_TEMPLATE_PARAMETERS 1
306 # define FMT_USE_NONTYPE_TEMPLATE_PARAMETERS 0
320 template <
bool B,
typename T =
void>
322 template <
bool B,
typename T,
typename F>
325 template <
typename T>
327 template <
typename T>
329 template <
typename T>
342 # define FMT_ENABLE_IF(...)
344 # define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
356 #ifdef __cpp_lib_is_constant_evaluated
360 return default_value;
370 const char* message);
375 # define FMT_ASSERT(condition, message) \
376 ::fmt::detail::ignore_unused((condition), (message))
378 # define FMT_ASSERT(condition, message) \
381 : ::fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
385 #ifdef __cpp_lib_byte
388 enum class byte : unsigned char {};
391 #if defined(FMT_USE_STRING_VIEW)
392 template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
393 #elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
394 template <
typename Char>
395 using std_string_view = std::experimental::basic_string_view<Char>;
400 #ifdef FMT_USE_INT128
402 #elif defined(__SIZEOF_INT128__) && !FMT_NVCC && \
403 !(FMT_CLANG_VERSION && FMT_MSC_VER)
404 # define FMT_USE_INT128 1
411 # define FMT_USE_INT128 0
423 template <
typename Int>
435 using uchar =
unsigned char;
437 uchar(
micro[1]) == 0xB5);
476 ?
std::strlen(reinterpret_cast<const char*>(
s))
480 template <
typename Traits,
typename Alloc>
482 const std::basic_string<Char, Traits, Alloc>&
s)
FMT_NOEXCEPT
511 size_t str_size = size_ < other.size_ ? size_ : other.size_;
512 int result = std::char_traits<Char>::compare(
data_, other.data_, str_size);
514 result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
521 return lhs.compare(rhs) == 0;
524 return lhs.compare(rhs) != 0;
527 return lhs.compare(rhs) < 0;
530 return lhs.compare(rhs) <= 0;
533 return lhs.compare(rhs) > 0;
536 return lhs.compare(rhs) >= 0;
543 template <
typename T>
struct is_char : std::false_type {};
544 template <>
struct is_char<char> : std::true_type {};
547 template <
typename Char, FMT_ENABLE_IF(is_
char<Char>::value)>
551 template <
typename Char,
typename Traits,
typename Alloc>
556 template <
typename Char>
561 template <
typename Char,
572 template <
typename S>
575 template <
typename S, FMT_ENABLE_IF(is_compile_
string<S>::value)>
589 template <
typename S>
590 struct is_string : std::is_class<decltype(to_string_view(std::declval<S>()))> {
602 #ifdef FMT_ENFORCE_COMPILE_STRING
604 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use "
632 template <
typename Char,
typename ErrorHandler = detail::error_handler>
645 : ErrorHandler(eh), format_str_(format_str), next_arg_id_(next_arg_id) {}
652 return format_str_.
begin();
659 return format_str_.
end();
674 if (next_arg_id_ >= 0)
return next_arg_id_++;
675 on_error(
"cannot switch from manual to automatic argument indexing");
684 if (next_arg_id_ > 0)
685 on_error(
"cannot switch from automatic to manual argument indexing");
693 ErrorHandler::on_error(message);
706 template <
typename T,
typename Char =
char,
typename Enable =
void>
714 template <
typename T,
typename Context>
716 std::is_constructible<typename Context::template formatter_type<T>>;
720 template <
typename Char>
727 template <
typename Context,
typename T>
729 -> decltype(
typename Context::template formatter_type<T>().
format(
730 std::declval<const T&>(), std::declval<Context&>()),
734 template <
typename Context>
738 template <
typename T,
typename Context>
740 return has_const_formatter_impl<Context>(
static_cast<T*
>(
nullptr));
744 template <
typename Container>
747 using bi_iterator = std::back_insert_iterator<Container>;
748 struct accessor : bi_iterator {
749 accessor(bi_iterator iter) : bi_iterator(iter) {}
750 using bi_iterator::container;
752 return *accessor(it).container;
755 template <
typename Char,
typename InputIt,
typename OutputIt>
762 template <
typename Char,
typename T,
typename U,
800 capacity_ = buf_capacity;
811 void operator=(
const buffer&) =
delete;
838 size_ =
count <= capacity_ ?
count : capacity_;
846 if (new_capacity > capacity_) grow(new_capacity);
850 try_reserve(size_ + 1);
851 ptr_[size_++] =
value;
855 template <
typename U>
void append(
const U*
begin,
const U*
end);
860 template <
typename I>
868 auto count() const ->
size_t {
return 0; }
879 auto count() const ->
size_t {
return count_; }
881 size_t n = limit_ > count_ ? limit_ - count_ : 0;
888 template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
892 enum { buffer_size = 256 };
897 if (this->
size() == buffer_size) flush();
910 : Traits(other),
buffer<
T>(
data_, 0, buffer_size), out_(other.out_) {}
920 template <
typename T>
926 enum { buffer_size = 256 };
931 if (this->
size() == this->capacity()) flush();
935 size_t n = this->limit(this->
size());
936 if (this->
data() == out_) {
938 this->
set(data_, buffer_size);
950 if (this->
data() != out_) {
951 this->
set(data_, buffer_size);
977 template <
typename Container>
980 typename Container::value_type>>
981 final :
public buffer<typename Container::value_type> {
987 container_.resize(capacity);
988 this->
set(&container_[0], capacity);
996 auto out() -> std::back_insert_iterator<Container> {
997 return std::back_inserter(container_);
1004 enum { buffer_size = 256 };
1010 if (this->
size() != buffer_size)
return;
1011 count_ += this->
size();
1021 template <
typename T>
1023 std::back_insert_iterator<buffer<T>>>;
1026 template <
typename T,
typename OutputIt>
1031 template <
typename Buffer>
1039 template <
typename T,
typename Char =
char,
typename Enable =
void>
1045 template <
typename T,
typename Char>
1047 std::is_constructible<fallback_formatter<T, Char>>;
1062 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1066 T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
1069 template <
typename... U>
1070 arg_data(
const U&... init) : args_{
T(named_args_, NUM_NAMED_ARGS), init...} {}
1071 arg_data(
const arg_data& other) =
delete;
1072 auto args() const -> const
T* {
return args_ + 1; }
1076 template <
typename T,
typename Char,
size_t NUM_ARGS>
1079 T args_[NUM_ARGS != 0 ? NUM_ARGS : +1];
1081 template <
typename... U>
1089 template <
typename Char>
1095 template <
typename T,
typename Char>
1098 template <
typename Char,
typename T,
typename... Tail,
1101 int named_arg_count,
const T&,
const Tail&... args) {
1105 template <
typename Char,
typename T,
typename... Tail,
1108 int named_arg_count,
const T&
arg,
const Tail&... args) {
1109 named_args[named_arg_count++] = {
arg.name, arg_count};
1113 template <
typename... Args>
1117 template <
bool B = false> constexpr
auto count() ->
size_t {
return B ? 1 : 0; }
1118 template <
bool B1,
bool B2,
bool... Tail> constexpr
auto count() ->
size_t {
1119 return (B1 ? 1 : 0) +
count<B2, Tail...>();
1126 template <
typename... Args>
1155 template <
typename T,
typename Char>
1158 #define FMT_TYPE_CONSTANT(Type, constant) \
1159 template <typename Char> \
1160 struct type_constant<Type, Char> \
1161 : std::integral_constant<type, type::constant> {}
1179 return t > type::none_type && t <= type::last_integer_type;
1183 return t > type::none_type && t <= type::last_numeric_type;
1208 template <
typename Context>
class value {
1248 string.data = val.
data();
1249 string.size = val.
size();
1253 : named_args{args,
size} {}
1257 custom.value =
const_cast<value_type*
>(&val);
1261 custom.format = format_custom_arg<
1264 typename Context::template formatter_type<value_type>,
1274 template <
typename T,
typename Formatter>
1276 typename Context::parse_context_type& parse_ctx,
1278 auto f = Formatter();
1279 parse_ctx.advance_to(f.parse(parse_ctx));
1280 using qualified_type =
1282 ctx.advance_to(f.format(*
static_cast<qualified_type*
>(
arg), ctx));
1286 template <
typename Context,
typename T>
1317 ->
unsigned long long {
1324 template <
typename T, FMT_ENABLE_IF(std::is_same<T,
char>::value ||
1325 std::is_same<T,
char_type>::value)>
1329 template <
typename T, enable_if_t<(std::is_same<T,
wchar_t>::value ||
1330 #ifdef __cpp_
char8_t
1331 std::is_same<T,
char8_t>::value ||
1333 std::is_same<T,
char16_t>::value ||
1334 std::is_same<T,
char32_t>::value) &&
1335 !std::is_same<T,
char_type>::value,
1353 template <
typename T,
1360 template <
typename T,
1366 template <
typename T,
1392 return map(
reinterpret_cast<const char*
>(val));
1396 return map(
reinterpret_cast<const char*
>(val));
1400 return map(
reinterpret_cast<const char*
>(val));
1404 return map(
reinterpret_cast<const char*
>(val));
1428 template <
typename T, std::size_t N,
1434 template <
typename T,
1440 -> decltype(std::declval<arg_mapper>().
map(
1446 return map(
static_cast<unsigned char>(val));
1449 template <
typename T,
typename U = remove_cvref_t<T>>
1452 !std::is_const<remove_reference_t<T>>::value ||
1453 has_fallback_formatter<U, char_type>::value> {};
1455 #if FMT_MSC_VER != 0 && FMT_MSC_VER < 1910
1461 template <
typename T, FMT_ENABLE_IF(formattable<T>::value)>
1465 template <
typename T, FMT_ENABLE_IF(!formattable<T>::value)>
1471 template <
typename T,
typename U = remove_cvref_t<T>,
1472 FMT_ENABLE_IF(!is_
string<U>::value && !is_
char<U>::value &&
1473 !std::is_array<U>::value &&
1474 (has_formatter<U, Context>::value ||
1475 has_fallback_formatter<U,
char_type>::value))>
1477 -> decltype(this->do_map(std::forward<T>(val))) {
1478 return do_map(std::forward<T>(val));
1481 template <
typename T, FMT_ENABLE_IF(is_named_arg<T>::value)>
1491 template <
typename T,
typename Context>
1493 type_constant<decltype(arg_mapper<Context>().map(std::declval<const T&>())),
1494 typename Context::char_type>;
1506 class appender :
public std::back_insert_iterator<detail::buffer<char>> {
1507 using base = std::back_insert_iterator<detail::buffer<char>>;
1509 template <
typename T>
1515 using std::back_insert_iterator<detail::buffer<char>>::back_insert_iterator;
1531 template <
typename ContextType,
typename T>
1535 template <
typename Visitor,
typename Ctx>
1538 -> decltype(vis(0));
1545 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1549 : value_(args,
size) {}
1556 void format(
typename Context::parse_context_type& parse_ctx,
1557 Context& ctx)
const {
1558 custom_.format(custom_.value, parse_ctx, ctx);
1568 return type_ != detail::type::none_type;
1586 template <
typename Visitor,
typename Context>
1589 switch (
arg.type_) {
1590 case detail::type::none_type:
1592 case detail::type::int_type:
1593 return vis(
arg.value_.int_value);
1594 case detail::type::uint_type:
1595 return vis(
arg.value_.uint_value);
1596 case detail::type::long_long_type:
1597 return vis(
arg.value_.long_long_value);
1598 case detail::type::ulong_long_type:
1599 return vis(
arg.value_.ulong_long_value);
1600 case detail::type::int128_type:
1602 case detail::type::uint128_type:
1604 case detail::type::bool_type:
1605 return vis(
arg.value_.bool_value);
1606 case detail::type::char_type:
1607 return vis(
arg.value_.char_value);
1608 case detail::type::float_type:
1609 return vis(
arg.value_.float_value);
1610 case detail::type::double_type:
1611 return vis(
arg.value_.double_value);
1612 case detail::type::long_double_type:
1613 return vis(
arg.value_.long_double_value);
1614 case detail::type::cstring_type:
1615 return vis(
arg.value_.string.data);
1616 case detail::type::string_type:
1618 return vis(sv(
arg.value_.string.data,
arg.value_.string.size));
1619 case detail::type::pointer_type:
1620 return vis(
arg.value_.pointer);
1621 case detail::type::custom_type:
1629 template <
typename Char,
typename InputIt>
1635 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
1637 template <
typename... Ts>
struct void_t_impl {
using type =
void; };
1638 template <
typename... Ts>
1639 using void_t =
typename detail::void_t_impl<Ts...>
::type;
1644 template <
typename It,
typename T,
typename Enable =
void>
1647 template <
typename It,
typename T>
1651 decltype(*std::declval<It>() = std::declval<T>())>>
1652 : std::true_type {};
1654 template <
typename OutputIt>
1656 template <
typename Container>
1658 : std::true_type {};
1660 template <
typename OutputIt>
1662 template <
typename Container>
1675 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1679 template <
typename Locale>
auto get() const -> Locale;
1686 template <
typename Context,
typename Arg,
typename... Args>
1692 template <
typename Context,
typename T>
1703 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1708 constexpr
bool formattable_char =
1710 static_assert(formattable_char,
"Mixing character types is disallowed.");
1712 constexpr
bool formattable_const =
1714 static_assert(formattable_const,
"Cannot format a const argument.");
1720 constexpr
bool formattable_pointer =
1722 static_assert(formattable_pointer,
1723 "Formatting of non-void pointers is disallowed.");
1725 constexpr
bool formattable =
1729 "Cannot format an argument. To make type T formattable provide a "
1730 "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
1734 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1737 return make_arg<Context>(
value);
1768 : out_(out), args_(ctx_args), loc_(loc) {}
1772 return args_.
get(name);
1775 return args_.
get_id(name);
1782 void on_error(
const char* message) { error_handler().on_error(message); }
1795 template <
typename Char>
1801 #define FMT_BUFFER_CONTEXT(Char) \
1802 basic_format_context<detail::buffer_appender<Char>, Char>
1804 template <
typename T,
typename Char =
char>
1806 !std::is_base_of<detail::unformattable,
1807 decltype(detail::arg_mapper<buffer_context<Char>>().
map(
1808 std::declval<T>()))>
::value &&
1818 template <
typename Context,
typename... Args>
1826 static const size_t num_args =
sizeof...(Args);
1839 static constexpr
unsigned long long desc =
1842 (num_named_args != 0
1847 template <
typename...
T>
1856 std::forward<T>(args))...} {
1872 return {std::forward<Args>(args)...};
1886 template <
typename Char,
typename T>
1933 return static_cast<detail::type>((desc_ >> shift) & mask);
1938 : desc_(desc), values_(
values) {}
1940 : desc_(desc), args_(args) {}
1950 template <
typename... Args>
1954 store.
data_.args()) {}
1979 if (
id < max_size())
arg = args_[
id];
1984 if (
arg.type_ == detail::type::none_type)
return arg;
1985 arg.value_ = values_[
id];
1989 template <
typename Char>
1991 int id = get_id(name);
1995 template <
typename Char>
1997 if (!has_named_args())
return -1;
1998 const auto& named_args =
1999 (is_packed() ? values_[-1] : args_[-1].value_).named_args;
2000 for (
size_t i = 0;
i < named_args.size; ++
i) {
2001 if (named_args.data[
i].name == name)
return named_args.data[
i].id;
2008 return static_cast<int>(is_packed() ? max_packed
2034 enum { max_size = 4 };
2035 Char
data_[max_size] = {Char(
' '), Char(0), Char(0), Char(0)};
2036 unsigned char size_ = 1;
2040 auto size =
s.size();
2043 size_ =
static_cast<unsigned char>(
size);
2046 constexpr
auto size() const ->
size_t {
return size_; }
2047 constexpr
auto data() const -> const Char* {
return data_; }
2133 template <
typename Char>
2151 : specs_(other.specs_) {}
2163 specs_.
fill[0] = Char(
'0');
2177 template <
typename ParseContext>
2179 :
public specs_setter<typename ParseContext::char_type> {
2189 specs_(other.specs_),
2190 context_(other.context_) {}
2193 specs_.width_ref = make_arg_ref(arg_id);
2197 specs_.precision_ref = make_arg_ref(arg_id);
2201 context_.on_error(message);
2211 context_.check_arg_id(arg_id);
2221 context_.check_arg_id(arg_id);
2223 context_.begin(),
to_unsigned(context_.end() - context_.begin()));
2229 return (c >=
'a' && c <=
'z') || (c >=
'A' && c <=
'Z');
2233 template <
typename Char, FMT_ENABLE_IF(std::is_
integral<Char>::value)>
2237 template <
typename Char, FMT_ENABLE_IF(std::is_enum<Char>::value)>
2243 template <
typename Char>
2247 "\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\0\0\0\0\0\0\0\0\2\2\2\2\3\3\4";
2248 int len = lengths[
static_cast<unsigned char>(*begin) >> 3];
2257 template <
bool IS_CONSTEXPR,
typename T,
typename Ptr = const T*>
2259 for (out =
first; out != last; ++out) {
2260 if (*out ==
value)
return true;
2267 const char*& out) ->
bool {
2268 out =
static_cast<const char*
>(
2270 return out !=
nullptr;
2275 template <
typename Char>
2277 int error_value) noexcept ->
int {
2279 unsigned value = 0, prev = 0;
2285 }
while (
p !=
end &&
'0' <= *
p && *
p <=
'9');
2286 auto num_digits =
p -
begin;
2289 return static_cast<int>(
value);
2293 prev * 10ull + unsigned(
p[-1] -
'0') <=
max
2294 ?
static_cast<int>(
value)
2299 template <
typename Char,
typename Handler>
2301 Handler&& handler) ->
const Char* {
2324 return handler.on_error(
"invalid fill character '{'"),
begin;
2329 handler.on_align(align);
2340 return (
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z') ||
'_' == c;
2343 template <
typename Char,
typename IDHandler>
2345 IDHandler&& handler) ->
const Char* {
2348 if (c >=
'0' && c <=
'9') {
2356 handler.on_error(
"invalid format string");
2362 handler.on_error(
"invalid format string");
2373 template <
typename Char,
typename IDHandler>
2375 IDHandler&& handler) ->
const Char* {
2382 template <
typename Char,
typename Handler>
2384 Handler&& handler) ->
const Char* {
2386 struct width_adapter {
2390 FMT_CONSTEXPR void operator()(
int id) { handler.on_dynamic_width(
id); }
2392 handler.on_dynamic_width(
id);
2395 if (message) handler.on_error(message);
2403 handler.on_width(width);
2405 handler.on_error(
"number is too big");
2406 }
else if (*
begin ==
'{') {
2410 return handler.on_error(
"invalid format string"),
begin;
2416 template <
typename Char,
typename Handler>
2418 Handler&& handler) ->
const Char* {
2420 struct precision_adapter {
2424 FMT_CONSTEXPR void operator()(
int id) { handler.on_dynamic_precision(
id); }
2426 handler.on_dynamic_precision(
id);
2429 if (message) handler.on_error(message);
2435 if (
'0' <= c && c <=
'9') {
2440 handler.on_error(
"number is too big");
2441 }
else if (c ==
'{') {
2446 return handler.on_error(
"invalid format string"),
begin;
2448 return handler.on_error(
"missing precision specifier"),
begin;
2450 handler.end_precision();
2454 template <
typename Char>
2458 return presentation_type::dec;
2460 return presentation_type::oct;
2462 return presentation_type::hex_lower;
2464 return presentation_type::hex_upper;
2466 return presentation_type::bin_lower;
2468 return presentation_type::bin_upper;
2470 return presentation_type::hexfloat_lower;
2472 return presentation_type::hexfloat_upper;
2474 return presentation_type::exp_lower;
2476 return presentation_type::exp_upper;
2478 return presentation_type::fixed_lower;
2480 return presentation_type::fixed_upper;
2482 return presentation_type::general_lower;
2484 return presentation_type::general_upper;
2486 return presentation_type::chr;
2488 return presentation_type::string;
2490 return presentation_type::pointer;
2498 template <
typename Char,
typename SpecHandler>
2501 SpecHandler&& handler)
2507 handler.on_error(
"invalid type specifier");
2508 handler.on_type(
type);
2536 if (*
begin ==
'#') {
2542 if (*
begin ==
'0') {
2551 if (*
begin ==
'.') {
2556 if (*
begin ==
'L') {
2557 handler.on_localized();
2565 handler.on_error(
"invalid type specifier");
2566 handler.on_type(
type);
2571 template <
typename Char,
typename Handler>
2573 Handler&& handler) ->
const Char* {
2578 FMT_CONSTEXPR void operator()() { arg_id = handler.on_arg_id(); }
2579 FMT_CONSTEXPR void operator()(
int id) { arg_id = handler.on_arg_id(
id); }
2581 arg_id = handler.on_arg_id(
id);
2584 if (message) handler.on_error(message);
2589 if (
begin ==
end)
return handler.on_error(
"invalid format string"),
end;
2590 if (*
begin ==
'}') {
2591 handler.on_replacement_field(handler.on_arg_id(),
begin);
2592 }
else if (*
begin ==
'{') {
2595 auto adapter = id_adapter{handler, 0};
2599 handler.on_replacement_field(adapter.arg_id,
begin);
2600 }
else if (c ==
':') {
2601 begin = handler.on_format_specs(adapter.arg_id,
begin + 1,
end);
2603 return handler.on_error(
"unknown format specifier"),
end;
2605 return handler.on_error(
"missing '}' in format string"),
end;
2611 template <
bool IS_CONSTEXPR,
typename Char,
typename Handler>
2625 handler.on_text(
begin,
p - 1);
2627 }
else if (c ==
'}') {
2628 if (
p ==
end || *
p !=
'}')
2629 return handler.on_error(
"unmatched '}' in format string");
2630 handler.on_text(
begin,
p);
2638 FMT_CONSTEXPR void operator()(
const Char* pbegin,
const Char* pend) {
2639 if (pbegin == pend)
return;
2641 const Char*
p =
nullptr;
2642 if (!find<IS_CONSTEXPR>(pbegin, pend, Char(
'}'),
p))
2643 return handler_.on_text(pbegin, pend);
2645 if (
p == pend || *
p !=
'}')
2646 return handler_.on_error(
"unmatched '}' in format string");
2647 handler_.on_text(pbegin,
p);
2657 if (*
begin !=
'{' && !find<IS_CONSTEXPR>(
begin + 1,
end, Char(
'{'),
p))
2664 template <
typename T,
typename ParseContext>
2666 -> decltype(ctx.begin()) {
2667 using char_type =
typename ParseContext::char_type;
2675 return f.parse(ctx);
2682 template <
typename Char,
typename ErrorHandler = error_handler>
2693 : base(format_str, eh), num_args_(num_args) {}
2696 int id = base::next_arg_id();
2697 if (
id >= num_args_) this->on_error(
"argument not found");
2702 base::check_arg_id(
id);
2703 if (
id >= num_args_) this->on_error(
"argument not found");
2705 using base::check_arg_id;
2708 template <
typename ErrorHandler>
2710 ErrorHandler&& eh) {
2711 if (
type > presentation_type::bin_upper &&
type != presentation_type::chr)
2712 eh.on_error(
"invalid type specifier");
2716 template <
typename Char,
typename ErrorHandler = error_handler>
2718 ErrorHandler&& eh = {}) ->
bool {
2720 specs.
type != presentation_type::chr) {
2725 eh.on_error(
"invalid format specifier for char");
2748 template <
typename ErrorHandler = error_handler,
typename Char>
2750 ErrorHandler&& eh = {})
2752 auto result = float_specs();
2755 switch (specs.
type) {
2757 result.format = float_format::general;
2759 case presentation_type::general_upper:
2762 case presentation_type::general_lower:
2763 result.format = float_format::general;
2765 case presentation_type::exp_upper:
2768 case presentation_type::exp_lower:
2769 result.format = float_format::exp;
2772 case presentation_type::fixed_upper:
2775 case presentation_type::fixed_lower:
2776 result.format = float_format::fixed;
2779 case presentation_type::hexfloat_upper:
2782 case presentation_type::hexfloat_lower:
2783 result.format = float_format::hex;
2786 eh.on_error(
"invalid type specifier");
2792 template <
typename ErrorHandler = error_handler>
2794 ErrorHandler&& eh = {}) ->
bool {
2797 if (
type != presentation_type::pointer) eh.on_error(
"invalid type specifier");
2801 template <
typename ErrorHandler = error_handler>
2803 ErrorHandler&& eh = {}) {
2805 eh.on_error(
"invalid type specifier");
2808 template <
typename ErrorHandler>
2810 ErrorHandler&& eh) {
2812 eh.on_error(
"invalid type specifier");
2823 this->on_error(
"format specifier requires numeric argument");
2828 : Handler(handler), arg_type_(arg_type) {}
2832 Handler::on_align(align);
2836 require_numeric_argument();
2838 arg_type_ != type::long_long_type && arg_type_ != type::char_type) {
2839 this->on_error(
"format specifier requires signed argument");
2841 Handler::on_sign(
s);
2845 require_numeric_argument();
2850 require_numeric_argument();
2851 Handler::on_localized();
2855 require_numeric_argument();
2861 this->on_error(
"precision not allowed for this argument type");
2867 #if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2868 template <
int N,
typename T,
typename... Args,
typename Char>
2871 if (
name == T::name)
return N;
2873 if constexpr (
sizeof...(Args) > 0)
2880 template <
typename... Args,
typename Char>
2882 #if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2883 if constexpr (
sizeof...(Args) > 0)
2890 template <
typename Char,
typename ErrorHandler,
typename... Args>
2894 enum { num_args =
sizeof...(Args) };
2905 : context_(format_str, num_args, eh),
2906 parse_funcs_{&parse_format_specs<Args, parse_context_type>...} {}
2915 #if FMT_USE_NONTYPE_TEMPLATE_PARAMETERS
2921 on_error(
"compile-time checks for named arguments require C++20 support");
2932 return id >= 0 &&
id < num_args ? parse_funcs_[
id](context_) :
begin;
2940 template <
typename... Args,
typename S,
2947 (parse_format_string<true>(
s, checker(
s, {})),
true);
2951 template <
typename Char>
2955 locale_ref loc = {});
2965 template <
typename T,
typename Char>
2968 detail::type::custom_type>> {
2975 template <
typename ParseContext>
2977 auto begin = ctx.begin(),
end = ctx.end();
2984 auto eh = ctx.error_handler();
2986 case detail::type::none_type:
2989 case detail::type::bool_type:
2991 specs_.
type == presentation_type::string) {
2995 case detail::type::int_type:
2996 case detail::type::uint_type:
2997 case detail::type::long_long_type:
2998 case detail::type::ulong_long_type:
2999 case detail::type::int128_type:
3000 case detail::type::uint128_type:
3003 case detail::type::char_type:
3006 case detail::type::float_type:
3012 case detail::type::double_type:
3016 FMT_ASSERT(
false,
"double support disabled");
3018 case detail::type::long_double_type:
3022 FMT_ASSERT(
false,
"long double support disabled");
3024 case detail::type::cstring_type:
3027 case detail::type::string_type:
3030 case detail::type::pointer_type:
3033 case detail::type::custom_type:
3041 template <
typename FormatContext>
3043 -> decltype(ctx.out());
3054 template <
typename S,
3062 "passing views as lvalues is disallowed");
3063 #ifdef FMT_HAS_CONSTEVAL
3064 if constexpr (detail::count_named_args<Args...>() ==
3065 detail::count_statically_named_args<Args...>()) {
3068 detail::parse_format_string<true>(str_, checker(
s, {}));
3079 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
3086 template <
typename... Args>
3116 template <
typename...
T>
3123 template <
typename OutputIt,
3127 auto&& buf = get_buffer<char>(out);
3144 template <
typename OutputIt,
typename...
T,
3158 template <
typename OutputIt,
typename...
T,
3165 return {buf.out(), buf.count()};
3176 template <
typename OutputIt,
typename...
T,
3184 template <
typename...
T>
3186 T&&... args) ->
size_t {
3205 template <
typename...
T>
3222 template <
typename...
T>
3233 #ifdef FMT_HEADER_ONLY
3236 #endif // FMT_CORE_H_
auto out() -> iterator
Definition: core.h:1785
GeneratorWrapper< T > map(Func &&function, GeneratorWrapper< U > &&generator)
Definition: catch.hpp:4276
char value_type
Definition: core.h:807
typename basic_string_view< Char >::iterator iterator
Definition: core.h:640
bool binary32
Definition: core.h:2743
int index
Definition: core.h:2125
buffer_context< char > format_context
Definition: core.h:1798
auto format(format_string< T... > fmt, T &&... args) -> std::string
Definition: core.h:3117
char_type char_value
Definition: core.h:1221
void on_localized()
Definition: core.h:2159
const void * pointer
Definition: core.h:1225
arg_ref(int index)
Definition: core.h:2109
T * out_
Definition: core.h:925
typename detail::char_t_impl< S >::type char_t
Definition: core.h:623
basic_string_view< char > string_view
Definition: core.h:540
void on_error(const char *message)
Definition: core.h:1782
auto get_arg_index_by_name(basic_string_view< Char > name) -> int
Definition: core.h:2881
constexpr auto data() const -> const Char *
Definition: core.h:2047
byte
Definition: core.h:388
remove_cvref_t< decltype(*detail::range_begin(std::declval< Range >()))> value_type
Definition: ranges.h:226
auto get_iterator(buffer< T > &buf) -> buffer_appender< T >
Definition: core.h:1035
constexpr value(float val)
Definition: core.h:1238
void ignore_unused(const T &...)
Definition: core.h:352
auto parse_align(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2300
@ minus
Definition: core.h:2025
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
Definition: core.h:1027
int next_arg_id_
Definition: core.h:636
auto map(bool val) -> bool
Definition: core.h:1322
auto code_point_length(const Char *begin) -> int
Definition: core.h:2244
void on_sign(sign_t s)
Definition: core.h:2835
void end_precision()
Definition: core.h:2859
constexpr unsigned char micro[]
Definition: core.h:430
#define FMT_USE_LONG_DOUBLE
Definition: core.h:211
auto convert_for_visit(T) -> monostate
Definition: core.h:417
arg_data(const U &... init)
Definition: core.h:1070
constexpr value(long long val)
Definition: core.h:1234
void check_arg_id(int)
Definition: core.h:683
void parse_format_string(basic_string_view< Char > format_str, Handler &&handler)
Definition: core.h:2612
constexpr auto end() const -> iterator
Definition: core.h:658
const void * locale_
Definition: core.h:1671
Insert the data and pilot values
Definition: generate_data.m:83
auto map(const T(&values)[N]) -> const T(&)[N]
Definition: core.h:1430
end IFFT Reshape the symbol vector into two different spatial streams size
Definition: generate_data.m:73
dynamic_specs_handler(dynamic_format_specs< char_type > &specs, ParseContext &ctx)
Definition: core.h:2183
auto parse_replacement_field(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2572
basic_format_args< basic_format_context > args_
Definition: core.h:1749
auto make_arg_ref(basic_string_view< char_type > arg_id) -> arg_ref_type
Definition: core.h:2219
OutputIt out_
Definition: core.h:891
unsigned long long ulong_long_value
Definition: core.h:1217
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
Definition: chrono.h:425
void void_t
Definition: core.h:1641
value(const named_arg_info< char_type > *args, size_t size)
Definition: core.h:1252
#define FMT_MSC_WARNING(...)
Definition: core.h:63
auto vformat(string_view fmt, format_args args) -> std::string
Definition: format-inl.h:2584
constexpr monostate()
Definition: core.h:335
void push_back(const T &value)
Definition: core.h:849
type_constant< decltype(arg_mapper< Context >().map(std::declval< const T & >())), typename Context::char_type > mapped_type_constant
Definition: core.h:1494
void vprint(std::FILE *f, string_view fmt, format_args args)
Definition: format-inl.h:2620
constexpr value(double val)
Definition: core.h:1239
const Char * data_
Definition: core.h:450
@ plus
Definition: core.h:2025
#define FMT_API
Definition: core.h:269
T * ptr_
Definition: core.h:780
bool locale
Definition: core.h:2742
void vprint_mojibake(std::FILE *, string_view, format_args)
Definition: core.h:2959
auto make_arg_ref(auto_id) -> arg_ref_type
Definition: core.h:2215
const char * iterator
Definition: core.h:455
#define FMT_TYPE_CONSTANT(Type, constant)
Definition: core.h:1158
value(int id=0)
Definition: core.h:2122
GeneratorWrapper< T > value(T &&value)
Definition: catch.hpp:3999
constexpr auto is_utf8() -> bool
Definition: core.h:432
dynamic_format_specs< char_type > & specs_
Definition: core.h:2205
@ left
Definition: core.h:2021
bool fallback
Definition: core.h:2744
#define FMT_USE_DOUBLE
Definition: core.h:208
std::is_constructible< fallback_formatter< T, Char > > has_fallback_formatter
Definition: core.h:1047
constexpr Char sign(Sign s)
Definition: format.h:929
#define FMT_INLINE
Definition: core.h:218
iterator_buffer(iterator_buffer &&other)
Definition: core.h:909
auto map(const char_type *val) -> const char_type *
Definition: core.h:1350
int num_args_
Definition: core.h:2686
constexpr auto size() const -> size_t
Definition: core.h:820
int id
Definition: core.h:1059
for p
Definition: process_rx_frame.m:36
auto map(const void *val) -> const void *
Definition: core.h:1408
auto map(uint128_t val) -> uint128_t
Definition: core.h:1321
auto map(unsigned val) -> unsigned
Definition: core.h:1310
value(T &val)
Definition: core.h:1255
auto map(unsigned char val) -> unsigned
Definition: core.h:1302
auto compare(basic_string_view other) const -> int
Definition: core.h:510
#define FMT_GCC_VERSION
Definition: core.h:32
OutputIt out_
Definition: core.h:1748
void on_hash()
Definition: core.h:2844
void clear()
Definition: core.h:832
auto args() const -> const basic_format_args< basic_format_context > &
Definition: core.h:1777
constexpr auto capacity() const -> size_t
Definition: core.h:823
@ right
Definition: core.h:2021
auto named_args() -> std::nullptr_t
Definition: core.h:1084
detail::locale_ref loc_
Definition: core.h:1750
auto count() -> size_t
Definition: core.h:1018
T type
Definition: core.h:331
end IFFT Reshape the symbol vector into two different spatial streams length(tx_syms)/NUM_UE
auto parse_width(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2383
constexpr auto count_statically_named_args() -> size_t
Definition: core.h:1127
auto map(T) -> unformattable_char
Definition: core.h:1337
const Char * name
Definition: core.h:1058
constexpr auto arg(int id) const -> format_arg
Definition: core.h:1770
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:523
auto parse_precision(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition: core.h:2417
constexpr auto size() const -> size_t
Definition: core.h:495
size_t size_
Definition: core.h:451
void * value
Definition: core.h:1203
const char & const_reference
Definition: core.h:808
auto format_to_n(OutputIt out, size_t n, format_string< T... > fmt, T &&... args) -> format_to_n_result< OutputIt >
Definition: core.h:3178
auto data() const -> const T *
Definition: core.h:829
#define FMT_USE_FLOAT
Definition: core.h:205
friend auto get_buffer(appender out) -> detail::buffer< char > &
Definition: core.h:1510
bool_constant< !std::is_base_of< detail::unformattable, decltype(detail::arg_mapper< buffer_context< Char > >().map(std::declval< T >()))>::value &&!detail::has_fallback_formatter< T, Char >::value > is_formattable
Definition: core.h:1809
arg_ref(basic_string_view< Char > name)
Definition: core.h:2111
void advance_to(iterator it)
Definition: core.h:1788
constexpr auto count_named_args() -> size_t
Definition: core.h:1122
auto check_cstring_type_spec(presentation_type type, ErrorHandler &&eh={}) -> bool
Definition: core.h:2793
string_value< char_type > string
Definition: core.h:1226
iterator_buffer(OutputIt out, size_t n=buffer_size)
Definition: core.h:907
typename fmt::v8::basic_format_context ::char_type char_type
Definition: core.h:1210
type
Definition: core.h:2025
bool fill(const std::vector< Numeric > &x, const std::vector< Numeric > &y, const std::map< std::string, std::string > &keywords)
Definition: matplotlibcpp.h:790
auto map(double val) -> double
Definition: core.h:1342
auto check_char_specs(const basic_format_specs< Char > &specs, ErrorHandler &&eh={}) -> bool
Definition: core.h:2717
void on_sign(sign_t s)
Definition: core.h:2157
auto map(const unsigned char *val) -> cstring_result
Definition: core.h:1394
const T & value
Definition: core.h:1053
bool is_name_start(Char c)
Definition: core.h:2339
arg_ref()
Definition: core.h:2107
float_format
Definition: core.h:2730
#define FMT_GCC_PRAGMA(arg)
Definition: core.h:40
void on_dynamic_width(Id arg_id)
Definition: core.h:2192
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:532
iterator_buffer(iterator_buffer &&other)
Definition: core.h:946
@ is_unpacked_bit
Definition: core.h:1499
void on_error(const char *message)
Definition: core.h:692
auto operator++(int) -> appender
Definition: core.h:1521
auto map(detail::byte val) -> unsigned
Definition: core.h:1445
auto find< false, char >(const char *first, const char *last, char value, const char *&out) -> bool
Definition: core.h:2266
@ long_short
Definition: core.h:1291
static void format_custom_arg(void *arg, typename Context::parse_context_type &parse_ctx, Context &ctx)
Definition: core.h:1275
index
Definition: parse_all_dl.m:11
void grow(size_t) override
Definition: core.h:930
basic_string_view< Char > format_str_
Definition: core.h:635
#define FMT_NORETURN
Definition: core.h:176
void try_reserve(size_t new_capacity)
Definition: core.h:845
constexpr basic_string_view(const Char *s, size_t count)
Definition: core.h:460
detail::type arg_type_
Definition: core.h:2819
arg_id_kind kind
Definition: core.h:2120
size_t size_
Definition: core.h:781
@ max_packed_args
Definition: core.h:1498
compile_parse_context(basic_string_view< Char > format_str, int num_args=(std::numeric_limits< int >::max)(), ErrorHandler eh={})
Definition: core.h:2690
iterator_buffer(T *out, size_t n=buffer_size)
Definition: core.h:944
auto out() -> std::back_insert_iterator< Container >
Definition: core.h:996
#define FMT_BUFFER_CONTEXT(Char)
Definition: core.h:1801
auto map(float val) -> float
Definition: core.h:1341
auto runtime(const S &s) -> basic_runtime< char_t< S >>
Definition: core.h:3098
constexpr value(bool val)
Definition: core.h:1241
value(uint128_t val)
Definition: core.h:1237
auto map(void *val) -> const void *
Definition: core.h:1407
auto get(const nlohmann::detail::iteration_proxy_value< IteratorType > &i) -> decltype(i.key())
Definition: json.hpp:5193
Char char_type
Definition: core.h:1745
auto begin() const -> const T *
Definition: core.h:816
auto parse_nonnegative_int(const Char *&begin, const Char *end, int error_value) noexcept -> int
Definition: core.h:2276
#define FMT_ENABLE_IF(...)
Definition: core.h:344
value(basic_string_view< char_type > val)
Definition: core.h:1247
auto next_arg_id() -> int
Definition: core.h:671
named_arg(const Char *n, const T &v)
Definition: core.h:1054
void check_pointer_type_spec(presentation_type type, ErrorHandler &&eh)
Definition: core.h:2809
constexpr bool is_integral_type(type t)
Definition: core.h:1178
constexpr auto error_handler() const -> ErrorHandler
Definition: core.h:696
constexpr value(unsigned long long val)
Definition: core.h:1235
auto map(std::nullptr_t val) -> const void *
Definition: core.h:1411
void flush()
Definition: core.h:934
auto count() const -> size_t
Definition: core.h:917
auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2258
#define FMT_NOEXCEPT
Definition: core.h:164
counting_buffer()
Definition: core.h:1016
constexpr auto to_ascii(Char value) -> Char
Definition: core.h:2234
presentation_type
Definition: core.h:2056
void on_width(int width)
Definition: core.h:2166
basic_format_specs< Char > & specs_
Definition: core.h:2144
auto map(const T &val) -> decltype(std::declval< arg_mapper >().map(static_cast< typename std::underlying_type< T >::type >(val)))
Definition: core.h:1439
auto format_to(OutputIt out, format_string< T... > fmt, T &&... args) -> OutputIt
Definition: core.h:3146
friend auto operator==(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:518
void check_int_type_spec(presentation_type type, ErrorHandler &&eh)
Definition: core.h:2709
Char iterator
Definition: core.h:1753
auto map(short val) -> int
Definition: core.h:1305
auto args() const -> const T *
Definition: core.h:1072
std::integral_constant< bool, B > bool_constant
Definition: core.h:324
typename ParseContext::char_type char_type
Definition: core.h:2181
constexpr auto begin() const -> iterator
Definition: core.h:651
value(const char_type *val)
Definition: core.h:1243
void on_zero()
Definition: core.h:2854
~iterator_buffer()
Definition: core.h:955
uint8_t data_[]
Definition: radio_socket.cc:21
typename std::remove_const< T >::type remove_const_t
Definition: core.h:328
uint16_t len
Definition: eth_common.h:62
basic_string_view(const std::basic_string< Char, Traits, Alloc > &s)
Definition: core.h:481
constexpr basic_format_parse_context(basic_string_view< Char > format_str, ErrorHandler eh={}, int next_arg_id=0)
Definition: core.h:642
@ none
Definition: core.h:2025
auto limit(size_t size) -> size_t
Definition: core.h:869
for i
Definition: generate_data.m:107
#define FMT_END_NAMESPACE
Definition: core.h:240
#define FMT_NODISCARD
Definition: core.h:200
auto count() const -> size_t
Definition: core.h:961
void assert_fail(const char *file, int line, const char *message)
Definition: format-inl.h:34
auto limit(size_t size) -> size_t
Definition: core.h:880
j template void())
Definition: json.hpp:4744
void grow(size_t) override
Definition: core.h:896
const Char * data
Definition: core.h:1192
constexpr auto count() -> size_t
Definition: core.h:1118
void flush()
Definition: core.h:900
auto locale() -> detail::locale_ref
Definition: core.h:1792
@ center
Definition: core.h:2021
typename fmt::v8::basic_format_context ::parse_context_type parse_context
Definition: core.h:1202
auto get_container(std::back_insert_iterator< Container > it) -> Container &
Definition: core.h:745
@ packed_arg_bits
Definition: core.h:1496
arg_id_kind
Definition: core.h:2103
auto map(long double val) -> long double
Definition: core.h:1343
std::back_insert_iterator< detail::buffer< char > > base
Definition: core.h:1507
auto begin() -> T *
Definition: core.h:813
void remove_prefix(size_t n)
Definition: core.h:504
custom_value< Context > custom
Definition: core.h:1227
constexpr auto end() const -> iterator
Definition: core.h:498
constexpr auto const_check(T value) -> T
Definition: core.h:365
void end_precision()
Definition: core.h:2170
value(const void *val)
Definition: core.h:1251
auto parse_presentation_type(Char type) -> presentation_type
Definition: core.h:2455
auto do_map(T &&) -> unformattable_const
Definition: core.h:1466
fixed_buffer_traits(size_t limit)
Definition: core.h:878
auto named_args() -> named_arg_info< Char > *
Definition: core.h:1073
size_t size
Definition: core.h:1193
auto formatted_size(format_string< T... > fmt, T &&... args) -> size_t
Definition: core.h:3185
auto make_arg_ref(int arg_id) -> arg_ref_type
Definition: core.h:2210
auto operator=(int idx) -> arg_ref &
Definition: core.h:2114
void require_numeric_argument()
Definition: core.h:2821
std::is_constructible< typename Context::template formatter_type< T > > has_formatter
Definition: core.h:716
buffer_traits(size_t)
Definition: core.h:867
auto map(unsigned long val) -> ulong_type
Definition: core.h:1312
constexpr value(int val)
Definition: core.h:1232
buffer(T *p=nullptr, size_t sz=0, size_t cap=0)
Definition: core.h:789
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:526
auto map(long val) -> long_type
Definition: core.h:1311
size_t size
Definition: core.h:1198
conditional_t< long_short, int, long long > long_type
Definition: core.h:1292
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
Definition: core.h:1887
void on_align(align_t align)
Definition: core.h:2153
auto map(const T &) -> unformattable_pointer
Definition: core.h:1424
specs_checker(const Handler &handler, detail::type arg_type)
Definition: core.h:2827
float_format format
Definition: core.h:2739
constexpr basic_string_view()
Definition: core.h:457
constexpr auto make_format_args(Args &&... args) -> format_arg_store< Context, remove_cvref_t< Args >... >
Definition: core.h:1870
#define FMT_CONSTEXPR_CHAR_TRAITS
Definition: core.h:135
auto operator[](size_t index) const -> const Char &
Definition: core.h:2050
auto map(const signed char *val) -> cstring_result
Definition: core.h:1390
constexpr auto begin() const -> iterator
Definition: core.h:497
@ numeric
Definition: core.h:2021
void on_zero()
Definition: core.h:2161
auto end() -> T *
Definition: core.h:814
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:529
int int_value
Definition: core.h:1214
auto out() -> T *
Definition: core.h:957
constexpr auto digits10() -> int
Definition: format.h:1042
constexpr bool is_arithmetic_type(type t)
Definition: core.h:1182
type
Definition: core.h:2021
auto map(signed char val) -> int
Definition: core.h:1301
int128_t
Definition: core.h:414
bool bool_value
Definition: core.h:1220
monostate no_value
Definition: core.h:1213
appender(base it)
Definition: core.h:1516
auto map(T &&val) -> decltype(this->do_map(std::forward< T >(val)))
Definition: core.h:1476
auto out() -> T *
Definition: core.h:973
float float_value
Definition: core.h:1222
constexpr bool is_ascii_letter(Char c)
Definition: core.h:2228
decltype(to_string_view(std::declval< S >())) result
Definition: core.h:595
auto map(...) -> unformattable
Definition: core.h:1487
constexpr auto size() const -> size_t
Definition: core.h:2046
auto map(T val) -> char_type
Definition: core.h:1326
void on_localized()
Definition: core.h:2849
iterator_buffer(Container &c)
Definition: core.h:992
auto map(char_type *val) -> const char_type *
Definition: core.h:1347
auto map(unsigned long long val) -> unsigned long long
Definition: core.h:1316
constexpr auto operator[](size_t pos) const -> const Char &
Definition: core.h:500
auto data() -> T *
Definition: core.h:826
basic_string_view(const Char *s)
Definition: core.h:472
Add CP Insert the cyclic prefix if(CP_LEN > 0) tx_cp
double double_value
Definition: core.h:1223
sign_t sign
Definition: core.h:2740
void grow(size_t capacity) override
Definition: core.h:986
#define FMT_FALLTHROUGH
Definition: core.h:193
constexpr auto data() const -> const Char *
Definition: core.h:492
conditional_t< std::is_same< char_type, char >::value, const char *, unformattable_pointer > cstring_result
Definition: core.h:1388
#define FMT_ASSERT(condition, message)
Definition: core.h:378
auto map(unsigned char *val) -> cstring_result
Definition: core.h:1402
constexpr auto is_constant_evaluated(bool default_value=false) -> bool
Definition: core.h:354
#define FMT_BEGIN_DETAIL_NAMESPACE
Definition: core.h:249
value(long double val)
Definition: core.h:1240
#define FMT_CONSTEVAL
Definition: core.h:296
void on_dynamic_precision(Id arg_id)
Definition: core.h:2196
#define FMT_MODULE_EXPORT_END
Definition: core.h:248
typename Context::char_type char_type
Definition: core.h:1299
auto args() const -> const T *
Definition: core.h:1083
#define FMT_MODULE_EXPORT_BEGIN
Definition: core.h:247
void init_named_args(std::nullptr_t, int, int, const Args &...)
Definition: core.h:1114
auto arg_id(basic_string_view< char_type > name) -> int
Definition: core.h:1774
long double long_double_value
Definition: core.h:1224
void on_align(align_t align)
Definition: core.h:2830
const T & first(const T &value, const Tail &...)
Definition: compile.h:178
constexpr int invalid_arg_index
Definition: core.h:2865
auto out() -> OutputIt
Definition: core.h:913
value(int128_t val)
Definition: core.h:1236
basic_string_view< Char > name
Definition: core.h:2126
@ has_named_args_bit
Definition: core.h:1500
specs_setter(basic_format_specs< Char > &specs)
Definition: core.h:2147
typename std::conditional< B, T, F >::type conditional_t
Definition: core.h:323
void check_arg_id(basic_string_view< Char >)
Definition: core.h:690
Definition: json.hpp:5213
auto map(const T &named_arg) -> decltype(std::declval< arg_mapper >().map(named_arg.value))
Definition: core.h:1482
void check_format_string(S)
Definition: core.h:2942
auto map(const T &val) -> basic_string_view< char_type >
Definition: core.h:1356
void advance_to(iterator it)
Definition: core.h:663
auto make_arg(const T &value) -> basic_format_arg< Context >
Definition: core.h:1736
Container & container_
Definition: core.h:983
Definition: bin_to_hex.h:102
size_t limit_
Definition: core.h:875
void set(T *buf_data, size_t buf_capacity)
Definition: core.h:798
const named_arg_info< Char > * data
Definition: core.h:1197
void operator=(basic_string_view< Char > s)
Definition: core.h:2039
void grow(size_t) override
Definition: core.h:1009
auto map(const T &) -> unformattable_char
Definition: core.h:1363
arg_data(const U &... init)
Definition: core.h:1082
unsigned uint_value
Definition: core.h:1215
auto next_arg_id() -> int
Definition: core.h:2695
auto vformat_to(OutputIt out, string_view fmt, format_args args) -> OutputIt
Definition: core.h:3125
constexpr value(unsigned val)
Definition: core.h:1233
iterator_buffer(T *out, size_t=0)
Definition: core.h:971
ParseContext & context_
Definition: core.h:2206
conditional_t< long_short, unsigned, unsigned long long > ulong_type
Definition: core.h:1293
constexpr value(char_type val)
Definition: core.h:1242
dynamic_specs_handler(const dynamic_specs_handler &other)
Definition: core.h:2187
auto operator[](I index) -> T &
Definition: core.h:857
#define FMT_BEGIN_NAMESPACE
Definition: core.h:237
void check_arg_id(int id)
Definition: core.h:2701
void on_type(presentation_type type)
Definition: core.h:2172
bool showpoint
Definition: core.h:2745
auto operator[](size_t index) -> Char &
Definition: core.h:2049
auto to_string_view(const Char *s) -> basic_string_view< Char >
Definition: core.h:548
void grow(size_t) override
Definition: core.h:968
auto error_handler() -> detail::error_handler
Definition: core.h:1781
void print(std::FILE *f, format_string< T... > fmt, T &&... args)
Definition: core.h:3223
auto end() const -> const T *
Definition: core.h:817
const Char * name
Definition: core.h:1052
uint16_t id
Definition: eth_common.h:65
auto map(unsigned short val) -> unsigned
Definition: core.h:1306
constexpr value()
Definition: core.h:1231
typename type_identity< T >::type type_identity_t
Definition: core.h:332
long long long_long_value
Definition: core.h:1216
uint128_t uint128_value
Definition: core.h:1219
int128_t int128_value
Definition: core.h:1218
basic_string_view(S s)
Definition: core.h:488
auto operator[](I index) const -> const T &
Definition: core.h:861
#define FMT_DEPRECATED
Definition: core.h:231
void check_string_type_spec(presentation_type type, ErrorHandler &&eh={})
Definition: core.h:2802
void on_precision(int precision)
Definition: core.h:2167
auto map(int val) -> int
Definition: core.h:1309
auto parse_format_specs(ParseContext &ctx) -> decltype(ctx.begin())
Definition: core.h:2665
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:321
typename result::value_type type
Definition: core.h:596
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool
Definition: core.h:535
auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
Definition: core.h:1587
auto do_parse_arg_id(const Char *begin, const Char *end, IDHandler &&handler) -> const Char *
Definition: core.h:2344
auto map(signed char *val) -> cstring_result
Definition: core.h:1398
auto count() const -> size_t
Definition: core.h:879
auto count() const -> size_t
Definition: core.h:868
void on_hash()
Definition: core.h:2158
auto copy_str(InputIt begin, InputIt end, appender out) -> appender
Definition: core.h:1630
void on_error(const char *message)
Definition: core.h:2200
uint128_t
Definition: core.h:415
void try_resize(size_t count)
Definition: core.h:836
auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
Definition: core.h:3160
named_arg_value< char_type > named_args
Definition: core.h:1228
typename std::remove_reference< T >::type remove_reference_t
Definition: core.h:326
constexpr auto encode_types() -> unsigned long long
Definition: core.h:1687
void throw_format_error(const char *message)
Definition: format-inl.h:43
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
Definition: core.h:994
auto map(int128_t val) -> int128_t
Definition: core.h:1320
auto operator++() -> appender &
Definition: core.h:1519
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T > >> buffer_appender
Definition: core.h:1023
#define FMT_END_DETAIL_NAMESPACE
Definition: core.h:250
int precision
Definition: core.h:2738
value(basic_string_view< Char > n)
Definition: core.h:2123
auto parse_float_type_spec(const basic_format_specs< Char > &specs, ErrorHandler &&eh={}) -> float_specs
Definition: core.h:2749
void on_fill(basic_string_view< Char > fill)
Definition: core.h:2154
auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
Definition: core.h:424
constexpr basic_format_context(OutputIt out, basic_format_args< basic_format_context > ctx_args, detail::locale_ref loc=detail::locale_ref())
Definition: core.h:1765
auto do_map(T &&val) -> T &
Definition: core.h:1462
#define FMT_CONSTEXPR20
Definition: core.h:119
~iterator_buffer()
Definition: core.h:911
auto map(long long val) -> long long
Definition: core.h:1315
Char char_type
Definition: core.h:639
@ space
Definition: core.h:2025
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
Definition: core.h:330
size_t capacity_
Definition: core.h:782
basic_string_view< Char > str
Definition: core.h:3046
#define FMT_CONSTEXPR
Definition: core.h:110
result
Definition: format-inl.h:640
#define FMT_UNICODE
Definition: core.h:284
specs_setter(const specs_setter &other)
Definition: core.h:2150
type
Definition: core.h:1131
auto arg(basic_string_view< char_type > name) -> format_arg
Definition: core.h:1771
bool upper
Definition: core.h:2741
constexpr auto has_const_formatter() -> bool
Definition: core.h:739
constexpr auto has_const_formatter_impl(...) -> bool
Definition: core.h:735
constexpr locale_ref()
Definition: core.h:1674
precision
Definition: inspect_single_frame.m:150
typename std::is_function< std::remove_pointer< std::remove_reference< T > >>::type is_function
Definition: matplotlibcpp.h:2758
auto parse_arg_id(const Char *begin, const Char *end, IDHandler &&handler) -> const Char *
Definition: core.h:2374
char value_type
Definition: core.h:454