WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
compile.h
Go to the documentation of this file.
1// Formatting library for C++ - experimental format string compilation
2//
3// Copyright (c) 2012 - present, Victor Zverovich and fmt contributors
4// All rights reserved.
5//
6// For the license information refer to format.h.
7
8#ifndef FMT_COMPILE_H_
9#define FMT_COMPILE_H_
10
11#ifndef FMT_MODULE
12# include <iterator> // std::back_inserter
13#endif
14
15#include "format.h"
16
19
20// A compile-time string which is compiled into fast formatting code.
22
23template <typename S>
24struct is_compiled_string : std::is_base_of<compiled_string, S> {};
25
26/**
27 * Converts a string literal `s` into a format string that will be parsed at
28 * compile time and converted into efficient formatting code. Requires C++17
29 * `constexpr if` compiler support.
30 *
31 * **Example**:
32 *
33 * // Converts 42 into std::string using the most efficient method and no
34 * // runtime format string processing.
35 * std::string s = fmt::format(FMT_COMPILE("{}"), 42);
36 */
37#if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
38# define FMT_COMPILE(s) FMT_STRING_IMPL(s, fmt::compiled_string)
39#else
40# define FMT_COMPILE(s) FMT_STRING(s)
41#endif
42
43/**
44 * Converts a string literal into a format string that will be parsed at
45 * compile time and converted into efficient formatting code. Requires support
46 * for class types in constant template parameters (a C++20 feature).
47 *
48 * **Example**:
49 *
50 * // Converts 42 into std::string using the most efficient method and no
51 * // runtime format string processing.
52 * using namespace fmt::literals;
53 * std::string s = fmt::format("{}"_cf, 42);
54 */
55#if FMT_USE_NONTYPE_TEMPLATE_ARGS
56inline namespace literals {
57template <detail::fixed_string Str> constexpr auto operator""_cf() {
58 return FMT_COMPILE(Str.data);
59}
60} // namespace literals
61#endif
62
64
65namespace detail {
66
67template <typename T, typename... Tail>
68constexpr auto first(const T& value, const Tail&...) -> const T& {
69 return value;
70}
71
72#if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
73template <typename... T> struct type_list {};
74
75// Returns a reference to the argument at index N from [first, rest...].
76template <int N, typename T, typename... Args>
77constexpr auto get([[maybe_unused]] const T& first,
78 [[maybe_unused]] const Args&... rest) -> const auto& {
79 static_assert(N < 1 + sizeof...(Args), "index is out of bounds");
80 if constexpr (N == 0)
81 return first;
82 else
83 return detail::get<N - 1>(rest...);
84}
85
86# if FMT_USE_NONTYPE_TEMPLATE_ARGS
87template <int N, typename T, typename... Args, typename Char>
88constexpr auto get_arg_index_by_name(basic_string_view<Char> name) -> int {
89 if constexpr (is_static_named_arg<T>()) {
90 if (name == T::name) return N;
91 }
92 if constexpr (sizeof...(Args) > 0)
93 return get_arg_index_by_name<N + 1, Args...>(name);
94 (void)name; // Workaround an MSVC bug about "unused" parameter.
95 return -1;
96}
97# endif
98
99template <typename... Args, typename Char>
100FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view<Char> name) -> int {
101# if FMT_USE_NONTYPE_TEMPLATE_ARGS
102 if constexpr (sizeof...(Args) > 0)
103 return get_arg_index_by_name<0, Args...>(name);
104# endif
105 (void)name;
106 return -1;
107}
108
109template <typename Char, typename... Args>
110constexpr auto get_arg_index_by_name(basic_string_view<Char> name,
111 type_list<Args...>) -> int {
112 return get_arg_index_by_name<Args...>(name);
113}
114
115template <int N, typename> struct get_type_impl;
116
117template <int N, typename... Args> struct get_type_impl<N, type_list<Args...>> {
118 using type =
119 remove_cvref_t<decltype(detail::get<N>(std::declval<Args>()...))>;
120};
121
122template <int N, typename T>
123using get_type = typename get_type_impl<N, T>::type;
124
125template <typename T> struct is_compiled_format : std::false_type {};
126
127template <typename Char> struct text {
128 basic_string_view<Char> data;
129 using char_type = Char;
130
131 template <typename OutputIt, typename... T>
132 constexpr auto format(OutputIt out, const T&...) const -> OutputIt {
133 return write<Char>(out, data);
134 }
135};
136
137template <typename Char>
138struct is_compiled_format<text<Char>> : std::true_type {};
139
140template <typename Char>
141constexpr auto make_text(basic_string_view<Char> s, size_t pos, size_t size)
142 -> text<Char> {
143 return {{&s[pos], size}};
144}
145
146template <typename Char> struct code_unit {
147 Char value;
148 using char_type = Char;
149
150 template <typename OutputIt, typename... T>
151 constexpr auto format(OutputIt out, const T&...) const -> OutputIt {
152 *out++ = value;
153 return out;
154 }
155};
156
157// This ensures that the argument type is convertible to `const T&`.
158template <typename T, int N, typename... Args>
159constexpr auto get_arg_checked(const Args&... args) -> const T& {
160 const auto& arg = detail::get<N>(args...);
161 if constexpr (detail::is_named_arg<remove_cvref_t<decltype(arg)>>()) {
162 return arg.value;
163 } else {
164 return arg;
165 }
166}
167
168template <typename Char>
169struct is_compiled_format<code_unit<Char>> : std::true_type {};
170
171// A replacement field that refers to argument N.
172template <typename Char, typename V, int N> struct field {
173 using char_type = Char;
174
175 template <typename OutputIt, typename... T>
176 constexpr auto format(OutputIt out, const T&... args) const -> OutputIt {
177 const V& arg = get_arg_checked<V, N>(args...);
178 if constexpr (std::is_convertible<V, basic_string_view<Char>>::value) {
179 auto s = basic_string_view<Char>(arg);
180 return copy<Char>(s.begin(), s.end(), out);
181 } else {
182 return write<Char>(out, arg);
183 }
184 }
185};
186
187template <typename Char, typename T, int N>
188struct is_compiled_format<field<Char, T, N>> : std::true_type {};
189
190// A replacement field that refers to argument with name.
191template <typename Char> struct runtime_named_field {
192 using char_type = Char;
193 basic_string_view<Char> name;
194
195 template <typename OutputIt, typename T>
196 constexpr static auto try_format_argument(
197 OutputIt& out,
198 // [[maybe_unused]] due to unused-but-set-parameter warning in GCC 7,8,9
199 [[maybe_unused]] basic_string_view<Char> arg_name, const T& arg) -> bool {
200 if constexpr (is_named_arg<typename std::remove_cv<T>::type>::value) {
201 if (arg_name == arg.name) {
202 out = write<Char>(out, arg.value);
203 return true;
204 }
205 }
206 return false;
207 }
208
209 template <typename OutputIt, typename... T>
210 constexpr auto format(OutputIt out, const T&... args) const -> OutputIt {
211 bool found = (try_format_argument(out, name, args) || ...);
212 if (!found) {
213 FMT_THROW(format_error("argument with specified name is not found"));
214 }
215 return out;
216 }
217};
218
219template <typename Char>
220struct is_compiled_format<runtime_named_field<Char>> : std::true_type {};
221
222// A replacement field that refers to argument N and has format specifiers.
223template <typename Char, typename V, int N> struct spec_field {
224 using char_type = Char;
225 formatter<V, Char> fmt;
226
227 template <typename OutputIt, typename... T>
228 constexpr FMT_INLINE auto format(OutputIt out, const T&... args) const
229 -> OutputIt {
230 const auto& vargs =
231 fmt::make_format_args<basic_format_context<OutputIt, Char>>(args...);
233 return fmt.format(get_arg_checked<V, N>(args...), ctx);
234 }
235};
236
237template <typename Char, typename T, int N>
238struct is_compiled_format<spec_field<Char, T, N>> : std::true_type {};
239
240template <typename L, typename R> struct concat {
241 L lhs;
242 R rhs;
243 using char_type = typename L::char_type;
244
245 template <typename OutputIt, typename... T>
246 constexpr auto format(OutputIt out, const T&... args) const -> OutputIt {
247 out = lhs.format(out, args...);
248 return rhs.format(out, args...);
249 }
250};
251
252template <typename L, typename R>
253struct is_compiled_format<concat<L, R>> : std::true_type {};
254
255template <typename L, typename R>
256constexpr auto make_concat(L lhs, R rhs) -> concat<L, R> {
257 return {lhs, rhs};
258}
259
260struct unknown_format {};
261
262template <typename Char>
263constexpr auto parse_text(basic_string_view<Char> str, size_t pos) -> size_t {
264 for (size_t size = str.size(); pos != size; ++pos) {
265 if (str[pos] == '{' || str[pos] == '}') break;
266 }
267 return pos;
268}
269
270template <typename Args, size_t POS, int ID, typename S>
271constexpr auto compile_format_string(S fmt);
272
273template <typename Args, size_t POS, int ID, typename T, typename S>
274constexpr auto parse_tail(T head, S fmt) {
275 if constexpr (POS != basic_string_view<typename S::char_type>(fmt).size()) {
276 constexpr auto tail = compile_format_string<Args, POS, ID>(fmt);
277 if constexpr (std::is_same<remove_cvref_t<decltype(tail)>,
278 unknown_format>())
279 return tail;
280 else
281 return make_concat(head, tail);
282 } else {
283 return head;
284 }
285}
286
287template <typename T, typename Char> struct parse_specs_result {
288 formatter<T, Char> fmt;
289 size_t end;
290 int next_arg_id;
291};
292
293enum { manual_indexing_id = -1 };
294
295template <typename T, typename Char>
296constexpr auto parse_specs(basic_string_view<Char> str, size_t pos,
297 int next_arg_id) -> parse_specs_result<T, Char> {
298 str.remove_prefix(pos);
299 auto ctx =
300 compile_parse_context<Char>(str, max_value<int>(), nullptr, next_arg_id);
301 auto f = formatter<T, Char>();
302 auto end = f.parse(ctx);
303 return {f, pos + fmt::detail::to_unsigned(end - str.data()),
304 next_arg_id == 0 ? manual_indexing_id : ctx.next_arg_id()};
305}
306
307template <typename Char> struct arg_id_handler {
308 arg_id_kind kind;
309 arg_ref<Char> arg_id;
310
311 constexpr auto on_auto() -> int {
312 FMT_ASSERT(false, "handler cannot be used with automatic indexing");
313 return 0;
314 }
315 constexpr auto on_index(int id) -> int {
316 kind = arg_id_kind::index;
317 arg_id = arg_ref<Char>(id);
318 return 0;
319 }
320 constexpr auto on_name(basic_string_view<Char> id) -> int {
321 kind = arg_id_kind::name;
322 arg_id = arg_ref<Char>(id);
323 return 0;
324 }
325};
326
327template <typename Char> struct parse_arg_id_result {
328 arg_id_kind kind;
329 arg_ref<Char> arg_id;
330 const Char* arg_id_end;
331};
332
333template <int ID, typename Char>
334constexpr auto parse_arg_id(const Char* begin, const Char* end) {
335 auto handler = arg_id_handler<Char>{arg_id_kind::none, arg_ref<Char>{}};
336 auto arg_id_end = parse_arg_id(begin, end, handler);
337 return parse_arg_id_result<Char>{handler.kind, handler.arg_id, arg_id_end};
338}
339
340template <typename T, typename Enable = void> struct field_type {
341 using type = remove_cvref_t<T>;
342};
343
344template <typename T>
345struct field_type<T, enable_if_t<detail::is_named_arg<T>::value>> {
346 using type = remove_cvref_t<decltype(T::value)>;
347};
348
349template <typename T, typename Args, size_t END_POS, int ARG_INDEX, int NEXT_ID,
350 typename S>
351constexpr auto parse_replacement_field_then_tail(S fmt) {
352 using char_type = typename S::char_type;
353 constexpr auto str = basic_string_view<char_type>(fmt);
354 constexpr char_type c = END_POS != str.size() ? str[END_POS] : char_type();
355 if constexpr (c == '}') {
356 return parse_tail<Args, END_POS + 1, NEXT_ID>(
357 field<char_type, typename field_type<T>::type, ARG_INDEX>(), fmt);
358 } else if constexpr (c != ':') {
359 FMT_THROW(format_error("expected ':'"));
360 } else {
361 constexpr auto result = parse_specs<typename field_type<T>::type>(
362 str, END_POS + 1, NEXT_ID == manual_indexing_id ? 0 : NEXT_ID);
363 if constexpr (result.end >= str.size() || str[result.end] != '}') {
364 FMT_THROW(format_error("expected '}'"));
365 return 0;
366 } else {
367 return parse_tail<Args, result.end + 1, result.next_arg_id>(
368 spec_field<char_type, typename field_type<T>::type, ARG_INDEX>{
369 result.fmt},
370 fmt);
371 }
372 }
373}
374
375// Compiles a non-empty format string and returns the compiled representation
376// or unknown_format() on unrecognized input.
377template <typename Args, size_t POS, int ID, typename S>
378constexpr auto compile_format_string(S fmt) {
379 using char_type = typename S::char_type;
380 constexpr auto str = basic_string_view<char_type>(fmt);
381 if constexpr (str[POS] == '{') {
382 if constexpr (POS + 1 == str.size())
383 FMT_THROW(format_error("unmatched '{' in format string"));
384 if constexpr (str[POS + 1] == '{') {
385 return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), fmt);
386 } else if constexpr (str[POS + 1] == '}' || str[POS + 1] == ':') {
387 static_assert(ID != manual_indexing_id,
388 "cannot switch from manual to automatic argument indexing");
389 constexpr auto next_id =
390 ID != manual_indexing_id ? ID + 1 : manual_indexing_id;
391 return parse_replacement_field_then_tail<get_type<ID, Args>, Args,
392 POS + 1, ID, next_id>(fmt);
393 } else {
394 constexpr auto arg_id_result =
395 parse_arg_id<ID>(str.data() + POS + 1, str.data() + str.size());
396 constexpr auto arg_id_end_pos = arg_id_result.arg_id_end - str.data();
397 constexpr char_type c =
398 arg_id_end_pos != str.size() ? str[arg_id_end_pos] : char_type();
399 static_assert(c == '}' || c == ':', "missing '}' in format string");
400 if constexpr (arg_id_result.kind == arg_id_kind::index) {
401 static_assert(
402 ID == manual_indexing_id || ID == 0,
403 "cannot switch from automatic to manual argument indexing");
404 constexpr auto arg_index = arg_id_result.arg_id.index;
405 return parse_replacement_field_then_tail<get_type<arg_index, Args>,
406 Args, arg_id_end_pos,
407 arg_index, manual_indexing_id>(
408 fmt);
409 } else if constexpr (arg_id_result.kind == arg_id_kind::name) {
410 constexpr auto arg_index =
411 get_arg_index_by_name(arg_id_result.arg_id.name, Args{});
412 if constexpr (arg_index >= 0) {
413 constexpr auto next_id =
414 ID != manual_indexing_id ? ID + 1 : manual_indexing_id;
415 return parse_replacement_field_then_tail<
416 decltype(get_type<arg_index, Args>::value), Args, arg_id_end_pos,
417 arg_index, next_id>(fmt);
418 } else if constexpr (c == '}') {
419 return parse_tail<Args, arg_id_end_pos + 1, ID>(
420 runtime_named_field<char_type>{arg_id_result.arg_id.name}, fmt);
421 } else if constexpr (c == ':') {
422 return unknown_format(); // no type info for specs parsing
423 }
424 }
425 }
426 } else if constexpr (str[POS] == '}') {
427 if constexpr (POS + 1 == str.size())
428 FMT_THROW(format_error("unmatched '}' in format string"));
429 return parse_tail<Args, POS + 2, ID>(make_text(str, POS, 1), fmt);
430 } else {
431 constexpr auto end = parse_text(str, POS + 1);
432 if constexpr (end - POS > 1) {
433 return parse_tail<Args, end, ID>(make_text(str, POS, end - POS), fmt);
434 } else {
435 return parse_tail<Args, end, ID>(code_unit<char_type>{str[POS]}, fmt);
436 }
437 }
438}
439
440template <typename... Args, typename S,
441 FMT_ENABLE_IF(is_compiled_string<S>::value)>
442constexpr auto compile(S fmt) {
443 constexpr auto str = basic_string_view<typename S::char_type>(fmt);
444 if constexpr (str.size() == 0) {
445 return detail::make_text(str, 0, 0);
446 } else {
447 constexpr auto result =
448 detail::compile_format_string<detail::type_list<Args...>, 0, 0>(fmt);
449 return result;
450 }
451}
452#endif // defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
453} // namespace detail
454
456
457#if defined(__cpp_if_constexpr) && defined(__cpp_return_type_deduction)
458
459template <typename CompiledFormat, typename... T,
460 typename Char = typename CompiledFormat::char_type,
461 FMT_ENABLE_IF(detail::is_compiled_format<CompiledFormat>::value)>
462FMT_INLINE FMT_CONSTEXPR_STRING auto format(const CompiledFormat& cf,
463 const T&... args)
464 -> std::basic_string<Char> {
465 auto s = std::basic_string<Char>();
466 cf.format(std::back_inserter(s), args...);
467 return s;
468}
469
470template <typename OutputIt, typename CompiledFormat, typename... T,
471 FMT_ENABLE_IF(detail::is_compiled_format<CompiledFormat>::value)>
472constexpr FMT_INLINE auto format_to(OutputIt out, const CompiledFormat& cf,
473 const T&... args) -> OutputIt {
474 return cf.format(out, args...);
475}
476
477template <typename S, typename... T,
479FMT_INLINE FMT_CONSTEXPR_STRING auto format(const S&, T&&... args)
480 -> std::basic_string<typename S::char_type> {
481 if constexpr (std::is_same<typename S::char_type, char>::value) {
482 constexpr auto str = basic_string_view<typename S::char_type>(S());
483 if constexpr (str.size() == 2 && str[0] == '{' && str[1] == '}') {
484 const auto& first = detail::first(args...);
485 if constexpr (detail::is_named_arg<
486 remove_cvref_t<decltype(first)>>::value) {
487 return fmt::to_string(first.value);
488 } else {
489 return fmt::to_string(first);
490 }
491 }
492 }
493 constexpr auto compiled = detail::compile<T...>(S());
494 if constexpr (std::is_same<remove_cvref_t<decltype(compiled)>,
495 detail::unknown_format>()) {
496 return fmt::format(
498 std::forward<T>(args)...);
499 } else {
500 return fmt::format(compiled, std::forward<T>(args)...);
501 }
502}
503
504template <typename OutputIt, typename S, typename... T,
506FMT_CONSTEXPR auto format_to(OutputIt out, const S&, T&&... args) -> OutputIt {
507 constexpr auto compiled = detail::compile<T...>(S());
508 if constexpr (std::is_same<remove_cvref_t<decltype(compiled)>,
509 detail::unknown_format>()) {
510 return fmt::format_to(
511 out, static_cast<basic_string_view<typename S::char_type>>(S()),
512 std::forward<T>(args)...);
513 } else {
514 return fmt::format_to(out, compiled, std::forward<T>(args)...);
515 }
516}
517#endif
518
519template <typename OutputIt, typename S, typename... T,
521auto format_to_n(OutputIt out, size_t n, const S& fmt, T&&... args)
523 using traits = detail::fixed_buffer_traits;
525 fmt::format_to(std::back_inserter(buf), fmt, std::forward<T>(args)...);
526 return {buf.out(), buf.count()};
527}
528
529template <typename S, typename... T,
531FMT_CONSTEXPR20 auto formatted_size(const S& fmt, T&&... args) -> size_t {
532 auto buf = detail::counting_buffer<>();
533 fmt::format_to(appender(buf), fmt, std::forward<T>(args)...);
534 return buf.count();
535}
536
537template <typename S, typename... T,
539void print(std::FILE* f, const S& fmt, T&&... args) {
540 auto buf = memory_buffer();
541 fmt::format_to(appender(buf), fmt, std::forward<T>(args)...);
542 detail::print(f, {buf.data(), buf.size()});
543}
544
545template <typename S, typename... T,
547void print(const S& fmt, T&&... args) {
548 print(stdout, fmt, std::forward<T>(args)...);
549}
550
551template <size_t N> class static_format_result {
552 private:
553 char data[N];
554
555 public:
556 template <typename S, typename... T,
558 explicit FMT_CONSTEXPR static_format_result(const S& fmt, T&&... args) {
559 *fmt::format_to(data, fmt, std::forward<T>(args)...) = '\0';
560 }
561
562 auto str() const -> fmt::string_view { return {data, N - 1}; }
563 auto c_str() const -> const char* { return data; }
564};
565
566/**
567 * Formats arguments according to the format string `fmt_str` and produces
568 * a string of the exact required size at compile time. Both the format string
569 * and the arguments must be compile-time expressions.
570 *
571 * The resulting string can be accessed as a C string via `c_str()` or as
572 * a `fmt::string_view` via `str()`.
573 *
574 * **Example**:
575 *
576 * // Produces the static string "42" at compile time.
577 * static constexpr auto result = FMT_STATIC_FORMAT("{}", 42);
578 * const char* s = result.c_str();
579 */
580#define FMT_STATIC_FORMAT(fmt_str, ...) \
581 fmt::static_format_result< \
582 fmt::formatted_size(FMT_COMPILE(fmt_str), __VA_ARGS__) + 1>( \
583 FMT_COMPILE(fmt_str), __VA_ARGS__)
584
587
588#endif // FMT_COMPILE_H_
#define S(label, offset, message)
Definition Errors.hpp:113
constexpr T & get(wpi::util::array< T, N > &arr) noexcept
Definition array.hpp:66
typename std::enable_if< B, T >::type enable_if_t
Definition base.h:307
#define FMT_ASSERT(condition, message)
Definition base.h:394
#define FMT_END_EXPORT
Definition base.h:267
basic_string_view< char > string_view
Definition base.h:620
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
Returns a named argument to be used in a formatting function.
Definition base.h:2846
detail::format_arg_store< context, sizeof...(T), detail::count_named_args< T... >(), detail::make_descriptor< context, T... >()> vargs
Definition base.h:2832
basic_appender< char > appender
Definition base.h:623
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
Definition base.h:316
#define FMT_CONSTEXPR
Definition base.h:113
arg_id_kind
Definition base.h:690
@ none
Definition base.h:690
@ index
Definition base.h:690
@ name
Definition base.h:690
#define FMT_BEGIN_NAMESPACE
Definition base.h:256
conditional_t< std::is_same< OutputIt, appender >::value, context, generic_context< OutputIt, Char > > basic_format_context
Definition base.h:636
#define FMT_ENABLE_IF(...)
Definition base.h:344
#define FMT_BEGIN_EXPORT
Definition base.h:266
#define FMT_INLINE
Definition base.h:250
#define FMT_CONSTEXPR20
Definition base.h:143
#define FMT_END_NAMESPACE
Definition base.h:259
An implementation of std::basic_string_view for pre-C++17.
Definition base.h:522
Definition compile.h:21
Definition base.h:1254
Definition base.h:2035
Definition base.h:1889
Definition base.h:1906
Definition base.h:2178
FMT_CONSTEXPR static_format_result(const S &fmt, T &&... args)
Definition compile.h:558
auto c_str() const -> const char *
Definition compile.h:563
auto str() const -> fmt::string_view
Definition compile.h:562
#define FMT_COMPILE(s)
Converts a string literal s into a format string that will be parsed at compile time and converted in...
Definition compile.h:40
void print(std::FILE *f, const S &fmt, T &&... args)
Definition compile.h:539
FMT_CONSTEXPR20 auto formatted_size(const S &fmt, T &&... args) -> size_t
Definition compile.h:531
FMT_BEGIN_EXPORT auto format_to_n(OutputIt out, size_t n, const S &fmt, T &&... args) -> format_to_n_result< OutputIt >
Definition compile.h:521
#define FMT_CONSTEXPR_STRING
Definition format.h:157
FMT_INLINE auto format(locale_ref loc, format_string< T... > fmt, T &&... args) -> std::string
Definition format.h:4305
FMT_INLINE auto format_to(OutputIt out, locale_ref loc, format_string< T... > fmt, T &&... args) -> OutputIt
Definition format.h:4321
basic_memory_buffer< char > memory_buffer
Definition format.h:919
#define FMT_THROW(x)
Definition format.h:177
Converts a string literal into a format string that will be parsed at compile time and converted into...
Definition printf.h:50
FMT_API void print(FILE *, string_view)
constexpr auto max_value() -> T
Definition format.h:427
constexpr Char string_literal< Char, C... >::value[sizeof...(C)]
Definition format.h:275
constexpr auto first(const T &value, const Tail &...) -> const T &
Definition compile.h:68
FMT_CONSTEXPR auto parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
Definition base.h:1358
type
Definition base.h:985
@ char_type
Definition base.h:995
Definition format.h:4143
Definition base.h:1067
Definition base.h:1068
Definition base.h:2879
Definition compile.h:24
Definition base.h:1289