17 #include <type_traits>
20 #define FMT_VERSION 100000
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_MSC_VERSION _MSC_VER
54 # define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
56 # define FMT_MSC_VERSION 0
57 # define FMT_MSC_WARNING(...)
61 # define FMT_CPLUSPLUS _MSVC_LANG
63 # define FMT_CPLUSPLUS __cplusplus
67 # define FMT_HAS_FEATURE(x) __has_feature(x)
69 # define FMT_HAS_FEATURE(x) 0
72 #if defined(__has_include) || FMT_ICC_VERSION >= 1600 || FMT_MSC_VERSION > 1900
73 # define FMT_HAS_INCLUDE(x) __has_include(x)
75 # define FMT_HAS_INCLUDE(x) 0
78 #ifdef __has_cpp_attribute
79 # define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
81 # define FMT_HAS_CPP_ATTRIBUTE(x) 0
84 #define FMT_HAS_CPP14_ATTRIBUTE(attribute) \
85 (FMT_CPLUSPLUS >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute))
87 #define FMT_HAS_CPP17_ATTRIBUTE(attribute) \
88 (FMT_CPLUSPLUS >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute))
92 #ifndef FMT_USE_CONSTEXPR
93 # if (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VERSION >= 1912 || \
94 (FMT_GCC_VERSION >= 600 && FMT_CPLUSPLUS >= 201402L)) && \
95 !FMT_ICC_VERSION && !defined(__NVCC__)
96 # define FMT_USE_CONSTEXPR 1
98 # define FMT_USE_CONSTEXPR 0
101 #if FMT_USE_CONSTEXPR
102 # define FMT_CONSTEXPR constexpr
104 # define FMT_CONSTEXPR
107 #if ((FMT_CPLUSPLUS >= 202002L) && \
108 (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE > 9)) || \
109 (FMT_CPLUSPLUS >= 201709L && FMT_GCC_VERSION >= 1002)
110 # define FMT_CONSTEXPR20 constexpr
112 # define FMT_CONSTEXPR20
116 #if defined(__GLIBCXX__)
117 # if FMT_CPLUSPLUS >= 201703L && defined(_GLIBCXX_RELEASE) && \
118 _GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
119 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr
121 #elif defined(_LIBCPP_VERSION) && FMT_CPLUSPLUS >= 201703L && \
122 _LIBCPP_VERSION >= 4000
123 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr
124 #elif FMT_MSC_VERSION >= 1914 && FMT_CPLUSPLUS >= 201703L
125 # define FMT_CONSTEXPR_CHAR_TRAITS constexpr
127 #ifndef FMT_CONSTEXPR_CHAR_TRAITS
128 # define FMT_CONSTEXPR_CHAR_TRAITS
132 #ifndef FMT_EXCEPTIONS
133 # if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \
134 (FMT_MSC_VERSION && !_HAS_EXCEPTIONS)
135 # define FMT_EXCEPTIONS 0
137 # define FMT_EXCEPTIONS 1
142 #if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VERSION && \
144 # define FMT_NORETURN [[noreturn]]
146 # define FMT_NORETURN
149 #ifndef FMT_NODISCARD
150 # if FMT_HAS_CPP17_ATTRIBUTE(nodiscard)
151 # define FMT_NODISCARD [[nodiscard]]
153 # define FMT_NODISCARD
158 # if FMT_GCC_VERSION || FMT_CLANG_VERSION
159 # define FMT_INLINE inline __attribute__((always_inline))
161 # define FMT_INLINE inline
166 #define FMT_FORWARD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__)
169 # define FMT_UNCHECKED_ITERATOR(It) \
170 using _Unchecked_type = It // Mark iterator as checked.
172 # define FMT_UNCHECKED_ITERATOR(It) using unchecked_type = It
175 #ifndef FMT_BEGIN_NAMESPACE
176 # define FMT_BEGIN_NAMESPACE \
178 inline namespace v10 {
179 # define FMT_END_NAMESPACE \
184 #ifndef FMT_MODULE_EXPORT
185 # define FMT_MODULE_EXPORT
186 # define FMT_BEGIN_EXPORT
187 # define FMT_END_EXPORT
190 #if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
191 # ifdef FMT_LIB_EXPORT
192 # define FMT_API __declspec(dllexport)
193 # elif defined(FMT_SHARED)
194 # define FMT_API __declspec(dllimport)
197 # if defined(FMT_LIB_EXPORT) || defined(FMT_SHARED)
198 # if defined(__GNUC__) || defined(__clang__)
199 # define FMT_API __attribute__((visibility("default")))
208 #if FMT_HAS_INCLUDE(<string_view>) && \
209 (FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
210 # include <string_view>
211 # define FMT_USE_STRING_VIEW
212 #elif FMT_HAS_INCLUDE("experimental/string_view") && FMT_CPLUSPLUS >= 201402L
213 # include <experimental/string_view>
214 # define FMT_USE_EXPERIMENTAL_STRING_VIEW
218 # define FMT_UNICODE !FMT_MSC_VERSION
221 #ifndef FMT_CONSTEVAL
222 # if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
223 (!defined(__apple_build_version__) || \
224 __apple_build_version__ >= 14000029L) && \
225 FMT_CPLUSPLUS >= 202002L) || \
226 (defined(__cpp_consteval) && \
227 (!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704))
229 # define FMT_CONSTEVAL consteval
230 # define FMT_HAS_CONSTEVAL
232 # define FMT_CONSTEVAL
236 #ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS
237 # if defined(__cpp_nontype_template_args) && \
238 ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \
239 __cpp_nontype_template_args >= 201911L) && \
240 !defined(__NVCOMPILER) && !defined(__LCC__)
241 # define FMT_USE_NONTYPE_TEMPLATE_ARGS 1
243 # define FMT_USE_NONTYPE_TEMPLATE_ARGS 0
247 #if defined __cpp_inline_variables && __cpp_inline_variables >= 201606L
248 # define FMT_INLINE_VARIABLE inline
250 # define FMT_INLINE_VARIABLE
255 #if !defined(__OPTIMIZE__) && !defined(__NVCOMPILER) && !defined(__LCC__) && \
263 template <
bool B,
typename T =
void>
265 template <
bool B,
typename T,
typename F>
268 template <
typename T>
270 template <
typename T>
272 template <
typename T>
276 template <
typename T>
287 # define FMT_ENABLE_IF(...)
289 # define FMT_ENABLE_IF(...) fmt::enable_if_t<(__VA_ARGS__), int> = 0
292 #ifdef __cpp_lib_byte
294 return static_cast<unsigned char>(
b);
305 bool default_value =
false) noexcept ->
bool {
309 #if FMT_CPLUSPLUS >= 202002L && defined(_GLIBCXX_RELEASE) && \
310 _GLIBCXX_RELEASE >= 12 && \
311 (FMT_CLANG_VERSION >= 1400 && FMT_CLANG_VERSION < 1500)
313 return __builtin_is_constant_evaluated();
314 #elif defined(__cpp_lib_is_constant_evaluated)
318 return default_value;
333 # define FMT_ASSERT(condition, message) \
334 fmt::detail::ignore_unused((condition), (message))
336 # define FMT_ASSERT(condition, message) \
339 : fmt::detail::assert_fail(__FILE__, __LINE__, (message)))
343 #if defined(FMT_USE_STRING_VIEW)
344 template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
345 #elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
346 template <
typename Char>
347 using std_string_view = std::experimental::basic_string_view<Char>;
352 #ifdef FMT_USE_INT128
354 #elif defined(__SIZEOF_INT128__) && !defined(__NVCC__) && \
355 !(FMT_CLANG_VERSION && FMT_MSC_VERSION)
356 # define FMT_USE_INT128 1
363 # define FMT_USE_INT128 0
373 template <
typename Int>
381 FMT_MSC_WARNING(suppress : 4566) constexpr
unsigned char section[] =
"\u00A7";
384 using uchar =
unsigned char;
386 uchar(section[1]) == 0xA7);
411 : data_(
s), size_(
count) {}
425 ? std::strlen(reinterpret_cast<const char*>(s))
426 : std::char_traits<Char>::
length(s)) {}
429 template <
typename Traits,
typename Alloc>
432 : data_(
s.data()), size_(
s.size()) {}
437 : data_(
s.data()), size_(
s.size()) {}
440 constexpr
auto data() const noexcept -> const Char* {
return data_; }
443 constexpr
auto size() const noexcept ->
size_t {
return size_; }
446 constexpr
auto end() const noexcept ->
iterator {
return data_ + size_; }
448 constexpr
auto operator[](
size_t pos)
const noexcept ->
const Char& {
459 return size_ >= sv.size_ &&
463 return size_ >= 1 && std::char_traits<Char>::eq(*data_,
c);
471 size_t str_size = size_ < other.size_ ? size_ : other.size_;
474 result = size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1);
481 return lhs.compare(rhs) == 0;
484 return lhs.compare(rhs) != 0;
487 return lhs.compare(rhs) < 0;
490 return lhs.compare(rhs) <= 0;
493 return lhs.compare(rhs) > 0;
496 return lhs.compare(rhs) >= 0;
505 template <
typename T>
struct is_char : std::false_type {};
506 template <>
struct is_char<char> : std::true_type {};
513 template <
typename S>
520 template <
typename Char,
typename Traits,
typename Alloc>
525 template <
typename Char>
530 template <
typename Char,
546 template <
typename S>
548 : std::is_class<decltype(detail::to_string_view(std::declval<S>()))> {};
580 template <
typename T,
typename Char>
583 #define FMT_TYPE_CONSTANT(Type, constant) \
584 template <typename Char> \
585 struct type_constant<Type, Char> \
586 : std::integral_constant<type, type::constant> {}
610 constexpr
auto set(
type rhs) ->
int {
return 1 <<
static_cast<int>(rhs); }
612 return ((
set >> static_cast<int>(
t)) & 1) != 0;
666 : format_str_(format_str), next_arg_id_(
next_arg_id) {}
673 return format_str_.begin();
679 constexpr
auto end() const noexcept ->
iterator {
return format_str_.end(); }
691 if (next_arg_id_ < 0) {
693 "cannot switch from manual to automatic argument indexing");
696 int id = next_arg_id_++;
706 if (next_arg_id_ > 0) {
708 "cannot switch from automatic to manual argument indexing");
723 template <
typename Char>
736 constexpr
auto num_args() const ->
int {
return num_args_; }
753 #if !defined(__LCC__)
761 template <
typename Char>
768 if (
id >= static_cast<context*>(
this)->num_args())
773 template <
typename Char>
779 static_cast<context*
>(
this)->check_dynamic_spec(arg_id);
789 template <
typename T,
typename Char =
char,
typename Enable =
void>
797 template <
typename T,
typename Context>
799 std::is_constructible<typename Context::template formatter_type<T>>;
803 template <
typename Char>
810 template <
typename Context,
typename T>
812 -> decltype(
typename Context::template formatter_type<T>().
format(
813 std::declval<const T&>(), std::declval<Context&>()),
817 template <
typename Context>
821 template <
typename T,
typename Context>
823 return has_const_formatter_impl<Context>(
static_cast<T*
>(
nullptr));
827 template <
typename Container>
830 using base = std::back_insert_iterator<Container>;
831 struct accessor : base {
832 accessor(base
b) : base(b) {}
833 using base::container;
835 return *accessor(it).container;
838 template <
typename Char,
typename InputIt,
typename OutputIt>
845 template <
typename Char,
typename T,
typename U,
851 if (size > 0) memcpy(out, begin, size *
sizeof(U));
870 buffer(
size_t sz) noexcept : size_(sz), capacity_(sz) {}
873 : ptr_(p), size_(sz), capacity_(cap) {}
881 capacity_ = buf_capacity;
901 constexpr
auto size() const noexcept ->
size_t {
return size_; }
904 constexpr
auto capacity() const noexcept ->
size_t {
return capacity_; }
919 size_ = count <= capacity_ ? count : capacity_;
927 if (new_capacity > capacity_)
grow(new_capacity);
932 ptr_[size_++] =
value;
941 template <
typename Idx>
949 auto count() const ->
size_t {
return 0; }
960 auto count() const ->
size_t {
return count_; }
962 size_t n = limit_ > count_ ? limit_ - count_ : 0;
969 template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
973 enum { buffer_size = 256 };
974 T data_[buffer_size];
978 if (this->
size() == buffer_size)
flush();
984 out_ = copy_str<T>(data_, data_ + this->limit(
size), out_);
989 : Traits(
n),
buffer<
T>(data_, 0, buffer_size), out_(out) {}
991 : Traits(other),
buffer<
T>(data_, 0, buffer_size), out_(other.out_) {}
1001 template <
typename T>
1007 enum { buffer_size = 256 };
1008 T data_[buffer_size];
1012 if (this->
size() == this->capacity()) flush();
1016 size_t n = this->limit(this->
size());
1017 if (this->
data() == out_) {
1019 this->
set(data_, buffer_size);
1031 if (this->
data() != out_) {
1032 this->
set(data_, buffer_size);
1058 template <
typename Container>
1061 typename Container::value_type>>
1062 final :
public buffer<typename Container::value_type> {
1064 Container& container_;
1068 container_.resize(capacity);
1069 this->
set(&container_[0], capacity);
1078 auto out() -> std::back_insert_iterator<Container> {
1079 return std::back_inserter(container_);
1086 enum { buffer_size = 256 };
1087 T data_[buffer_size];
1092 if (this->
size() != buffer_size)
return;
1093 count_ += this->
size();
1103 template <
typename T>
1105 std::back_insert_iterator<buffer<T>>>;
1108 template <
typename T,
typename OutputIt>
1112 template <
typename T,
typename Buf,
1118 template <
typename Buf,
typename OutputIt>
1122 template <
typename T,
typename OutputIt>
1140 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1144 T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
1147 template <
typename... U>
1154 template <
typename T,
typename Char,
size_t NUM_ARGS>
1159 template <
typename... U>
1167 template <
typename Char>
1173 template <
typename T,
typename Char>
1176 template <
typename Char,
typename T,
typename... Tail,
1179 int named_arg_count,
const T&,
const Tail&...
args) {
1183 template <
typename Char,
typename T,
typename... Tail,
1186 int named_arg_count,
const T&
arg,
const Tail&...
args) {
1187 named_args[named_arg_count++] = {arg.name, arg_count};
1191 template <
typename... Args>
1195 template <
bool B = false> constexpr
auto count() ->
size_t {
return B ? 1 : 0; }
1196 template <
bool B1,
bool B2,
bool... Tail> constexpr
auto count() ->
size_t {
1197 return (B1 ? 1 : 0) +
count<B2, Tail...>();
1204 template <
typename... Args>
1230 template <
typename Context>
class value {
1270 string.data = val.
data();
1271 string.size = val.
size();
1283 custom.format = format_custom_arg<
1284 value_type,
typename Context::template formatter_type<value_type>>;
1292 template <
typename T,
typename Formatter>
1293 static void format_custom_arg(
void*
arg,
1294 typename Context::parse_context_type& parse_ctx,
1296 auto f = Formatter();
1297 parse_ctx.advance_to(
f.parse(parse_ctx));
1298 using qualified_type =
1300 ctx.advance_to(
f.format(*static_cast<qualified_type*>(arg), ctx));
1304 template <
typename Context,
typename T>
1314 template <
typename U,
1316 static auto map(U*) -> decltype(
format_as(std::declval<U>()));
1319 using type = decltype(
map(static_cast<T*>(
nullptr)));
1323 template <
typename T>
1325 : bool_constant<!std::is_same<format_as_t<T>, void>::value> {};
1349 ->
unsigned long long {
1366 #ifdef __cpp_char8_t
1389 template <
typename T,
1396 template <
typename T,
1425 template <
typename T, std::size_t
N,
1432 template <
typename T,
typename U = format_as_t<T>,
1433 FMT_ENABLE_IF(std::is_arithmetic<U>::value)>
1438 template <
typename T,
typename U = remove_cvref_t<T>>
1440 : bool_constant<has_const_formatter<U, Context>() ||
1441 (has_formatter<U, Context>::value &&
1442 !std::is_const<remove_reference_t<T>>::value)> {};
1453 template <
typename T,
typename U = remove_cvref_t<T>,
1454 FMT_ENABLE_IF((std::is_
class<U>::value || std::is_enum<U>::value ||
1455 std::is_union<U>::value) &&
1456 !is_
string<U>::value && !is_
char<U>::value &&
1457 !is_named_arg<U>::value &&
1458 !std::is_arithmetic<format_as_t<U>>::value)>
1460 -> decltype(this->
do_map(std::forward<T>(val))) {
1461 return do_map(std::forward<T>(val));
1466 -> decltype(this->
map(named_arg.value)) {
1467 return map(named_arg.value);
1474 template <
typename T,
typename Context>
1476 type_constant<decltype(arg_mapper<Context>().map(std::declval<const T&>())),
1488 class appender :
public std::back_insert_iterator<detail::buffer<char>> {
1489 using base = std::back_insert_iterator<detail::buffer<char>>;
1492 using std::back_insert_iterator<detail::buffer<char>>::back_insert_iterator;
1507 template <
typename ContextType,
typename T>
1511 template <
typename Visitor,
typename Ctx>
1514 -> decltype(vis(0));
1519 using char_type =
typename Context::char_type;
1521 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1525 : value_(args, size) {}
1532 void format(
typename Context::parse_context_type& parse_ctx,
1534 custom_.format(custom_.value, parse_ctx, ctx);
1543 constexpr
explicit operator bool() const noexcept {
1563 template <
typename Visitor,
typename Context>
1566 switch (arg.type_) {
1570 return vis(arg.value_.int_value);
1572 return vis(arg.value_.uint_value);
1574 return vis(arg.value_.long_long_value);
1576 return vis(arg.value_.ulong_long_value);
1582 return vis(arg.value_.bool_value);
1584 return vis(arg.value_.char_value);
1586 return vis(arg.value_.float_value);
1588 return vis(arg.value_.double_value);
1590 return vis(arg.value_.long_double_value);
1592 return vis(arg.value_.string.data);
1595 return vis(sv(arg.value_.string.data, arg.value_.string.size));
1597 return vis(arg.value_.pointer);
1606 template <
typename Char,
typename InputIt>
1612 template <
typename Char,
typename R,
typename OutputIt>
1614 return detail::copy_str<Char>(rng.begin(), rng.end(), out);
1617 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 500
1619 template <
typename...>
struct void_t_impl {
using type =
void; };
1620 template <
typename...
T>
using void_t =
typename void_t_impl<
T...>
::type;
1625 template <
typename It,
typename T,
typename Enable =
void>
1628 template <
typename It,
typename T>
1632 decltype(*std::declval<It>() = std::declval<T>())>>
1633 : std::true_type {};
1636 template <
typename Container>
1638 : std::true_type {};
1640 template <
typename It>
1642 template <
typename Container>
1651 const void* locale_;
1655 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1657 explicit operator bool() const noexcept {
return locale_ !=
nullptr; }
1659 template <
typename Locale>
auto get()
const -> Locale;
1666 template <
typename Context,
typename Arg,
typename... Args>
1672 template <
typename Context,
typename T>
1677 constexpr
bool formattable_char =
1679 static_assert(formattable_char,
"Mixing character types is disallowed.");
1684 constexpr
bool formattable_pointer =
1686 static_assert(formattable_pointer,
1687 "Formatting of non-void pointers is disallowed.");
1692 "Cannot format an argument. To make type T formattable provide a "
1693 "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
1697 template <
typename Context,
typename T>
1701 arg.value_ = make_value<Context>(
value);
1708 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1711 return make_value<Context>(
val);
1714 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1717 return make_arg<Context>(
value);
1748 : out_(out), args_(ctx_args), loc_(loc) {}
1773 template <
typename Char>
1778 template <
typename T,
typename Char =
char>
1790 template <
typename Context,
typename... Args>
1798 static const size_t num_args =
sizeof...(Args);
1811 static constexpr
unsigned long long desc =
1814 (num_named_args != 0
1819 template <
typename...
T>
1858 template <
typename Char,
typename T>
1885 unsigned long long desc_;
1896 constexpr
auto is_packed() const ->
bool {
1899 auto has_named_args() const ->
bool {
1906 return static_cast<detail::type>((desc_ >> shift) & mask);
1911 : desc_(desc),
values_(values) {}
1913 : desc_(desc),
args_(args) {}
1923 template <
typename... Args>
1927 store.data_.
args()) {}
1937 : basic_format_args(store.get_types(), store.
data()) {}
1956 arg.type_ =
type(
id);
1962 template <
typename Char>
1968 template <
typename Char>
1970 if (!has_named_args())
return -1;
1971 const auto& named_args =
1972 (is_packed() ?
values_[-1] :
args_[-1].value_).named_args;
1973 for (
size_t i = 0; i < named_args.size; ++i) {
1974 if (named_args.data[i].name ==
name)
return named_args.data[i].id;
1981 return static_cast<int>(is_packed() ? max_packed
1995 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 903
1996 # define FMT_ENUM_UNDERLYING_TYPE(type)
1998 # define FMT_ENUM_UNDERLYING_TYPE(type) : type
2015 enum { max_size = 4 };
2016 Char data_[max_size] = {Char(
' '), Char(0), Char(0), Char(0)};
2017 unsigned char size_ = 1;
2023 for (
size_t i = 0; i <
size; ++i) data_[i] = s[i];
2024 size_ =
static_cast<unsigned char>(
size);
2027 constexpr
auto size() const ->
size_t {
return size_; }
2028 constexpr
auto data() const -> const Char* {
return data_; }
2032 return data_[
index];
2112 template <
typename Char =
char>
2121 return c <= 0xff ? static_cast<char>(
c) :
'\0';
2124 constexpr
auto to_ascii(Char c) ->
char {
2125 return c <= 0xff ? static_cast<char>(
c) :
'\0';
2129 template <
typename Char>
2132 auto c =
static_cast<unsigned char>(*begin);
2133 return static_cast<int>((0x3a55000000000000ull >> (2 * (c >> 3))) & 0x3) + 1;
2137 template <
bool IS_CONSTEXPR,
typename T,
typename Ptr = const T*>
2140 if (*out ==
value)
return true;
2147 const char*& out) ->
bool {
2148 out =
static_cast<const char*
>(
2150 return out !=
nullptr;
2155 template <
typename Char>
2157 int error_value) noexcept ->
int {
2159 unsigned value = 0, prev = 0;
2163 value = value * 10 + unsigned(*p -
'0');
2165 }
while (p !=
end &&
'0' <= *p && *p <=
'9');
2166 auto num_digits = p -
begin;
2169 return static_cast<int>(
value);
2173 prev * 10ull + unsigned(p[-1] -
'0') <= max
2174 ?
static_cast<int>(
value)
2185 return align::center;
2191 return (
'a' <= c && c <=
'z') || (
'A' <= c && c <=
'Z') || c ==
'_';
2194 template <
typename Char,
typename Handler>
2196 Handler&& handler) ->
const Char* {
2198 if (c >=
'0' && c <=
'9') {
2208 handler.on_index(index);
2223 template <
typename Char,
typename Handler>
2225 Handler&& handler) ->
const Char* {
2238 int id = ctx.next_arg_id();
2240 ctx.check_dynamic_spec(
id);
2244 ctx.check_arg_id(
id);
2245 ctx.check_dynamic_spec(
id);
2249 ctx.check_arg_id(
id);
2254 template <
typename Char>
2266 }
else if (*
begin ==
'{') {
2276 template <
typename Char>
2292 template <
typename Char>
2308 if (current_state >= s || !valid)
2326 } parse_presentation_type{
begin, specs, arg_type};
2343 specs.sign = sign::plus;
2346 specs.sign = sign::minus;
2349 specs.sign = sign::space;
2365 specs.align = align::numeric;
2366 specs.fill[0] = Char(
'0');
2391 specs.localized =
true;
2395 return parse_presentation_type(pres::dec, integral_set);
2397 return parse_presentation_type(pres::oct, integral_set);
2399 return parse_presentation_type(pres::hex_lower, integral_set);
2401 return parse_presentation_type(pres::hex_upper, integral_set);
2403 return parse_presentation_type(pres::bin_lower, integral_set);
2405 return parse_presentation_type(pres::bin_upper, integral_set);
2407 return parse_presentation_type(pres::hexfloat_lower,
float_set);
2409 return parse_presentation_type(pres::hexfloat_upper,
float_set);
2411 return parse_presentation_type(pres::exp_lower,
float_set);
2413 return parse_presentation_type(pres::exp_upper,
float_set);
2415 return parse_presentation_type(pres::fixed_lower,
float_set);
2417 return parse_presentation_type(pres::fixed_upper,
float_set);
2419 return parse_presentation_type(pres::general_lower,
float_set);
2421 return parse_presentation_type(pres::general_upper,
float_set);
2423 return parse_presentation_type(pres::chr, integral_set);
2425 return parse_presentation_type(pres::string,
2430 return parse_presentation_type(pres::debug,
2438 if (
end - fill_end <= 0) {
2442 if (*
begin ==
'{') {
2449 specs.align =
align;
2450 begin = fill_end + 1;
2458 template <
typename Char,
typename Handler>
2460 Handler&& handler) ->
const Char* {
2465 FMT_CONSTEXPR void on_auto() { arg_id = handler.on_arg_id(); }
2466 FMT_CONSTEXPR void on_index(
int id) { arg_id = handler.on_arg_id(
id); }
2468 arg_id = handler.on_arg_id(
id);
2473 if (
begin ==
end)
return handler.on_error(
"invalid format string"),
end;
2474 if (*
begin ==
'}') {
2475 handler.on_replacement_field(handler.on_arg_id(),
begin);
2476 }
else if (*
begin ==
'{') {
2479 auto adapter = id_adapter{handler, 0};
2483 handler.on_replacement_field(adapter.arg_id,
begin);
2484 }
else if (c ==
':') {
2485 begin = handler.on_format_specs(adapter.arg_id,
begin + 1,
end);
2487 return handler.on_error(
"unknown format specifier"),
end;
2489 return handler.on_error(
"missing '}' in format string"),
end;
2495 template <
bool IS_CONSTEXPR,
typename Char,
typename Handler>
2502 const Char* p =
begin;
2506 handler.on_text(
begin, p - 1);
2508 }
else if (c ==
'}') {
2509 if (p ==
end || *p !=
'}')
2510 return handler.on_error(
"unmatched '}' in format string");
2511 handler.on_text(
begin, p);
2519 FMT_CONSTEXPR void operator()(
const Char* from,
const Char* to) {
2520 if (from == to)
return;
2522 const Char* p =
nullptr;
2523 if (!find<IS_CONSTEXPR>(from, to, Char(
'}'), p))
2524 return handler_.on_text(from, to);
2526 if (p == to || *p !=
'}')
2527 return handler_.
on_error(
"unmatched '}' in format string");
2528 handler_.on_text(from, p);
2533 }
write = {handler};
2537 const Char* p =
begin;
2538 if (*
begin !=
'{' && !find<IS_CONSTEXPR>(
begin + 1,
end, Char(
'{'), p))
2552 template <
typename T,
typename ParseContext>
2554 -> decltype(ctx.begin()) {
2565 template <
typename Char>
2572 if (specs.align == align::numeric || specs.sign !=
sign::none || specs.alt)
2579 #if FMT_USE_NONTYPE_TEMPLATE_ARGS
2580 template <
int N,
typename T,
typename... Args,
typename Char>
2585 if constexpr (
sizeof...(Args) > 0)
2592 template <
typename... Args,
typename Char>
2594 #if FMT_USE_NONTYPE_TEMPLATE_ARGS
2595 if constexpr (
sizeof...(Args) > 0)
2605 static constexpr
int num_args =
sizeof...(Args);
2614 parse_func parse_funcs_[num_args > 0 ?
static_cast<size_t>(num_args) : 1];
2615 type types_[num_args > 0 ?
static_cast<size_t>(num_args) : 1];
2619 : context_(fmt, num_args, types_),
2620 parse_funcs_{&parse_format_specs<Args, parse_context_type>...},
2630 #if FMT_USE_NONTYPE_TEMPLATE_ARGS
2636 on_error(
"compile-time checks for named arguments require C++20 support");
2647 return id >= 0 &&
id < num_args ? parse_funcs_[
id](context_) :
begin;
2658 #ifdef FMT_ENFORCE_COMPILE_STRING
2660 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use "
2664 template <
typename... Args,
typename S,
2681 template <
typename Char>
2694 template <
typename T,
typename Char>
2696 enable_if_t<detail::type_constant<T, Char>::value !=
2702 template <
typename ParseContext>
2719 template <
typename FormatContext>
2721 -> decltype(ctx.out());
2724 #define FMT_FORMAT_AS(Type, Base) \
2725 template <typename Char> \
2726 struct formatter<Type, Char> : formatter<Base, Char> { \
2727 template <typename FormatContext> \
2728 auto format(const Type& val, FormatContext& ctx) const \
2729 -> decltype(ctx.out()) { \
2730 return formatter<Base, Char>::format(static_cast<Base>(val), ctx); \
2755 template <
typename S,
2763 "passing views as lvalues is disallowed");
2764 #ifdef FMT_HAS_CONSTEVAL
2765 if constexpr (detail::count_named_args<Args...>() ==
2766 detail::count_statically_named_args<Args...>()) {
2769 detail::parse_format_string<true>(str_,
checker(s));
2781 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
2786 template <
typename... Args>
2814 template <
typename...
T>
2821 template <
typename OutputIt,
2824 auto&&
buf = detail::get_buffer<char>(out);
2841 template <
typename OutputIt,
typename...
T,
2855 template <
typename OutputIt,
typename...
T,
2862 return {
buf.out(),
buf.count()};
2873 template <
typename OutputIt,
typename...
T,
2881 template <
typename...
T>
2883 T&&...
args) ->
size_t {
2902 template <
typename...
T>
2919 template <
typename...
T>
2930 template <
typename...
T>
2939 template <
typename...
T>
2948 #ifdef FMT_HEADER_ONLY
2951 #endif // FMT_CORE_H_
constexpr auto num_args() const -> int
FMT_INLINE value(const void *val)
FMT_CONSTEXPR FMT_INLINE auto map(int128_opt val) -> int128_opt
FMT_NORETURN FMT_API void throw_format_error(const char *message)
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long long val) -> unsigned long long
FMT_CONSTEXPR20 void try_resize(size_t count)
#define FMT_ENABLE_IF(...)
fixed_buffer_traits(size_t limit)
GLuint GLsizei const GLchar * message
FMT_CONSTEXPR auto next_arg_id() -> int
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
typename std::enable_if< B, T >::type enable_if_t
Define Imath::enable_if_t to be std for C++14, equivalent for C++11.
constexpr bool is_arithmetic_type(type t)
FMT_CONSTEXPR FMT_INLINE auto map(long long val) -> long long
GLenum GLuint GLenum GLsizei const GLchar * buf
void init_named_args(named_arg_info< Char > *, int, int)
auto vformat_to(OutputIt out, string_view fmt, format_args args) -> OutputIt
FMT_CONSTEXPR FMT_INLINE auto map(T) -> unformattable_char
typename basic_format_context::char_type char_type
typename detail::char_t_impl< S >::type char_t
FMT_CONSTEXPR20 void grow(size_t) override
FMT_API auto vformat(string_view fmt, format_args args) -> std::string
FMT_CONSTEXPR arg_ref(int index)
FMT_CONSTEXPR_CHAR_TRAITS friend auto operator==(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR FMT_INLINE auto map(float val) -> float
iterator_buffer(T *out, size_t=0)
FMT_CONSTEXPR auto parse_replacement_field(const Char *begin, const Char *end, Handler &&handler) -> const Char *
FMT_CONSTEXPR FMT_INLINE auto map(unsigned char val) -> unsigned
auto limit(size_t size) -> size_t
FMT_CONSTEXPR auto operator[](Idx index) const -> const T &
FMT_CONSTEXPR basic_string_view(S s) noexcept
FMT_CONSTEXPR FMT_INLINE auto map(unsigned long val) -> ulong_type
FMT_CONSTEXPR auto data() noexcept-> T *
remove_cvref_t< decltype(T::value)> type
FMT_CONSTEXPR20 void grow(size_t) override
FMT_INLINE auto end() noexcept-> T *
typename std::underlying_type< T >::type underlying_t
typename std::conditional< B, T, F >::type conditional_t
constexpr FMT_INLINE value(double val)
FMT_CONSTEXPR void check_arg_id(int id)
named_arg_info< Char > named_args_[NUM_NAMED_ARGS]
FMT_CONSTEXPR void ignore_unused(const T &...)
basic_format_context(basic_format_context &&)=default
GLsizei const GLfloat * value
type_constant< decltype(arg_mapper< Context >().map(std::declval< const T & >())), typename Context::char_type > mapped_type_constant
FMT_INLINE void println(std::FILE *f, format_string< T...> fmt, T &&...args)
FMT_INLINE auto end() const noexcept-> const T *
FMT_INLINE auto begin() noexcept-> T *
conditional_t< std::is_same< T, char >::value, appender, std::back_insert_iterator< buffer< T >>> buffer_appender
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, float failrelative, float warnrelative, ROI roi={}, int nthreads=0)
uint128_opt uint128_value
FMT_CONSTEXPR void on_name(basic_string_view< Char > id)
#define FMT_CONSTEXPR_CHAR_TRAITS
FMT_CONSTEXPR FMT_INLINE auto map(const char_type *val) -> const char_type *
void vformat_to(buffer< Char > &buf, basic_string_view< Char > fmt, typename vformat_args< Char >::type args, locale_ref loc={})
FMT_CONSTEXPR void advance_to(iterator it)
auto operator++() noexcept-> appender &
FMT_CONSTEXPR FMT_INLINE auto map(void *val) -> const void *
FMT_CONSTEXPR_CHAR_TRAITS FMT_INLINE basic_string_view(const Char *s)
GLuint GLsizei GLsizei * length
FMT_CONSTEXPR auto to_unsigned(Int value) -> typename std::make_unsigned< Int >::type
auto count() const -> size_t
auto runtime(string_view s) -> runtime_format_string<>
FMT_CONSTEXPR basic_string_view(const std::basic_string< Char, Traits, Alloc > &s) noexcept
**But if you need a or simply need to know when the task has note that the like this
constexpr auto is_name_start(Char c) -> bool
decltype(to_string_view(std::declval< S >())) result
ImageBuf OIIO_API checker(int width, int height, int depth, cspan< float > color1, cspan< float > color2, int xoffset, int yoffset, int zoffset, ROI roi, int nthreads=0)
constexpr error_handler()=default
FMT_CONSTEXPR FMT_INLINE auto map(std::nullptr_t val) -> const void *
**But if you need a result
FMT_CONSTEXPR FMT_INLINE void parse_format_string(basic_string_view< Char > format_str, Handler &&handler)
constexpr auto has_const_formatter() -> bool
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
FMT_CONSTEXPR FMT_INLINE auto map(int val) -> int
typename std::remove_cv< remove_reference_t< T >>::type remove_cvref_t
auto args() const -> const format_args &
auto vformat_to_n(OutputIt out, size_t n, string_view fmt, format_args args) -> format_to_n_result< OutputIt >
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
constexpr FMT_INLINE value(unsigned val)
FMT_CONSTEXPR auto operator[](Idx index) -> T &
FMT_INLINE value(uint128_opt val)
FMT_CONSTEXPR void check_arg_id(int id)
constexpr auto in(type t, int set) -> bool
bool_constant<!std::is_base_of< detail::unformattable, decltype(detail::arg_mapper< buffer_context< Char >>().map(std::declval< T >()))>::value > is_formattable
FMT_CONSTEXPR auto map(const T &) -> unformattable_pointer
FMT_CONSTEXPR20 void try_reserve(size_t new_capacity)
FMT_CONSTEXPR FMT_INLINE auto do_map(T &&val) -> T &
FMT_CONSTEXPR void operator=(basic_string_view< Char > s)
FMT_CONSTEXPR auto operator=(int idx) -> arg_ref &
FMT_INLINE auto get_iterator(Buf &buf, OutputIt) -> decltype(buf.out())
#define FMT_END_NAMESPACE
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 *
auto convert_for_visit(T) -> monostate
basic_string_view< char > string_view
FMT_CONSTEXPR FMT_INLINE auto map(const void *val) -> const void *
buffer_context< char > format_context
auto find< false, char >(const char *first, const char *last, char value, const char *&out) -> bool
FMT_CONSTEXPR auto copy_str(InputIt begin, InputIt end, OutputIt out) -> OutputIt
constexpr FMT_INLINE value()
auto named_args() -> named_arg_info< Char > *
constexpr auto end() const noexcept-> iterator
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
FMT_CONSTEXPR FMT_INLINE auto map(signed char val) -> int
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> basic_string_view< char_type >
FMT_CONSTEXPR auto arg(basic_string_view< Char > name) -> format_arg
long double long_double_value
FMT_CONSTEXPR auto check_char_specs(const format_specs< Char > &specs) -> bool
auto count() const -> size_t
FMT_INLINE auto to_string_view(const Char *s) -> basic_string_view< Char >
GLint GLint GLsizei GLint GLenum GLenum type
conditional_t< long_short, unsigned, unsigned long long > ulong_type
FMT_CONSTEXPR value(int idx=0)
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
#define FMT_MSC_WARNING(...)
FMT_CONSTEXPR FMT_INLINE auto map(const T &) -> unformattable_char
FMT_CONSTEXPR_CHAR_TRAITS auto compare(basic_string_view other) const -> int
FMT_CONSTEXPR arg_ref(basic_string_view< Char > name)
FMT_CONSTEXPR FMT_INLINE auto map(T &&val) -> decltype(this->do_map(std::forward< T >(val)))
FMT_CONSTEXPR void on_index(int id)
FMT_CONSTEXPR void set(T *buf_data, size_t buf_capacity) noexcept
iterator_buffer(T *out, size_t n=buffer_size)
FMT_NODISCARD FMT_INLINE auto format(format_string< T...> fmt, T &&...args) -> std::string
FMT_API void vprint(string_view fmt, format_args args)
FMT_CONSTEXPR auto make_arg(T &&value) -> basic_format_arg< Context >
constexpr basic_string_view() noexcept
constexpr auto end() const noexcept-> iterator
constexpr bool is_integral_type(type t)
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(Char c) const noexcept
FMT_CONSTEXPR FMT_INLINE auto map(T val) -> char_type
constexpr auto format_as(Enum e) noexcept-> underlying_t< Enum >
FMT_CONSTEXPR auto error_handler() -> detail::error_handler
constexpr FMT_INLINE value(unsigned long long val)
constexpr FMT_INLINE value(float val)
typename format_as_result< T >::type format_as_t
FMT_CONSTEXPR FMT_INLINE auto map(unsigned val) -> unsigned
FMT_CONSTEXPR FMT_INLINE auto map(const T &named_arg) -> decltype(this->map(named_arg.value))
auto get_container(std::back_insert_iterator< Container > it) -> Container &
constexpr auto set(type rhs) -> int
#define FMT_INLINE_VARIABLE
constexpr auto arg(int id) const -> format_arg
FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view< Char > name) -> int
auto out() -> std::back_insert_iterator< Container >
FMT_CONSTEXPR auto next_arg_id() -> int
constexpr FMT_INLINE locale_ref()
friend auto operator!=(basic_string_view lhs, basic_string_view rhs) -> bool
GLint GLint GLsizei GLint GLenum format
FMT_CONSTEXPR auto operator[](size_t index) -> Char &
typename result::value_type type
FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string< T...> fmt, T &&...args) -> format_to_n_result< OutputIt >
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(const Char *s) const
typename std::remove_reference< T >::type remove_reference_t
FMT_CONSTEXPR auto parse_align(char c) -> align_t
long long long_long_value
FMT_CONSTEXPR void remove_prefix(size_t n) noexcept
basic_string_view< Char > name
#define FMT_GCC_PRAGMA(arg)
constexpr auto has_const_formatter_impl(T *) -> decltype(typename Context::template formatter_type< T >().format(std::declval< const T & >(), std::declval< Context & >()), true)
constexpr auto count() -> size_t
FMT_CONSTEXPR FMT_INLINE auto make_value(T &&val) -> value< Context >
FMT_CONSTEXPR auto code_point_length(const Char *begin) -> int
enum type FMT_ENUM_UNDERLYING_TYPE(unsigned char)
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
constexpr FMT_INLINE_VARIABLE int invalid_arg_index
iterator_buffer(iterator_buffer &&other)
enum type FMT_ENUM_UNDERLYING_TYPE(unsigned char)
appender(base it) noexcept
FMT_CONSTEXPR auto arg_id(basic_string_view< Char > name) -> int
typename basic_format_context::parse_context_type parse_context
custom_value< Context > custom
constexpr FMT_INLINE value(int val)
FMT_CONSTEXPR FMT_INLINE value(const char_type *val)
basic_format_args< format_context > format_args
auto operator++(int) noexcept-> appender
GLuint const GLchar * name
typename Context::char_type char_type
constexpr auto size() const noexcept-> size_t
FMT_CONSTEXPR20 ~buffer()=default
IMATH_HOSTDEVICE constexpr int sign(T a) IMATH_NOEXCEPT
FMT_CONSTEXPR FMT_INLINE auto map(long val) -> long_type
FMT_CONSTEXPR auto data() const noexcept-> const T *
GLboolean GLboolean GLboolean b
auto args() const -> const T *
void advance_to(iterator it)
FMT_CONSTEXPR20 void grow(size_t capacity) override
FMT_MODULE_EXPORT FMT_CONSTEXPR FMT_INLINE auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
FMT_CONSTEXPR FMT_INLINE auto named_args() -> std::nullptr_t
constexpr FMT_INLINE value(long long val)
FMT_CONSTEXPR FMT_INLINE auto map(const T &val) -> decltype(this->map(U()))
unsigned long long ulong_long_value
GLenum GLint GLint * precision
FMT_CONSTEXPR FMT_INLINE auto map(char_type *val) -> const char_type *
constexpr auto size() const noexcept-> size_t
constexpr auto data() const -> const Char *
basic_format_parse_context< Char > & ctx
named_arg(const Char *n, const T &v)
__hostdev__ uint64_t last(uint32_t i) const
iterator_buffer(OutputIt out, size_t n=buffer_size)
constexpr auto make_format_args(T &&...args) -> format_arg_store< Context, remove_cvref_t< T >...>
typename std::remove_const< T >::type remove_const_t
void on_error(const char *message)
constexpr auto size() const -> size_t
FMT_CONSTEXPR FMT_INLINE auto map(double val) -> double
buffer(size_t sz) noexcept
FMT_UNCHECKED_ITERATOR(appender)
FMT_CONSTEXPR void check_dynamic_spec(int arg_id)
FMT_CONSTEXPR FMT_INLINE auto map(unsigned short val) -> unsigned
std::is_constructible< typename Context::template formatter_type< T >> has_formatter
friend auto operator>=(basic_string_view lhs, basic_string_view rhs) -> bool
typename pvt::make_void< Ts...>::type void_t
void operator=(const basic_format_context &)=delete
string_value< char_type > string
FMT_INLINE void check_format_string(const S &)
GLenum GLsizei GLsizei GLint * values
void append(const U *begin, const U *end)
friend auto operator>(basic_string_view lhs, basic_string_view rhs) -> bool
const named_arg_info< Char > * data
constexpr basic_string_view(const Char *s, size_t count) noexcept
FMT_CONSTEXPR FMT_INLINE value(T &val)
constexpr FMT_INLINE auto is_constant_evaluated(bool default_value=false) noexcept-> bool
typename type_identity< T >::type type_identity_t
FMT_CONSTEXPR FMT_INLINE auto map(bool val) -> bool
iterator_buffer(Container &c)
FMT_CONSTEXPR_CHAR_TRAITS bool starts_with(basic_string_view< Char > sv) const noexcept
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
auto count() const -> size_t
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_NORETURN void on_error(const char *message)
named_arg_value< char_type > named_args
iterator_buffer(iterator_buffer &&other)
FMT_CONSTEXPR value(basic_string_view< Char > n)
FMT_CONSTEXPR20 void push_back(const T &value)
constexpr auto count() -> size_t
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
auto map(...) -> unformattable
FMT_CONSTEXPR auto operator[](size_t index) const -> const Char &
GA_API const UT_StringHolder N
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 *
FMT_INLINE auto format_to(OutputIt out, format_string< T...> fmt, T &&...args) -> OutputIt
FMT_INLINE value(long double val)
Context provides a wrapper around the Core library context object.
**If you just want to fire and args
constexpr auto data() const noexcept-> const Char *
FMT_CONSTEXPR FMT_INLINE auto args() const -> const T *
FMT_TYPE_CONSTANT(int, int_type)
constexpr auto count_statically_named_args() -> size_t
constexpr auto encode_types() -> unsigned long long
FMT_CONSTEXPR FMT_INLINE auto map(uint128_opt val) -> uint128_opt
FMT_CONSTEXPR auto do_parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
constexpr FMT_INLINE value(char_type val)
FMT_CONSTEXPR auto is_utf8() -> bool
friend auto operator<=(basic_string_view lhs, basic_string_view rhs) -> bool
union detail::arg_ref::value val
constexpr auto arg_type(int id) const -> type
conditional_t< long_short, int, long long > long_type
constexpr auto begin() const noexcept-> iterator
#define FMT_ASSERT(condition, message)
FMT_CONSTEXPR auto parse_nonnegative_int(const Char *&begin, const Char *end, int error_value) noexcept-> int
GLsizei GLenum GLenum * types
FMT_CONSTEXPR20 void grow(size_t) override
#define FMT_BEGIN_NAMESPACE
auto get_buffer(OutputIt out) -> iterator_buffer< OutputIt, T >
const wchar_t & const_reference
constexpr auto to_ascii(Char c) -> char
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
FMT_CONSTEXPR FMT_INLINE auto map(long double val) -> long double
arg_data(const U &...init)
FMT_CONSTEXPR compile_parse_context(basic_string_view< Char > format_str, int num_args, const type *types, int next_arg_id=0)
FMT_CONSTEXPR auto out() -> iterator
constexpr basic_format_parse_context(basic_string_view< Char > format_str, int next_arg_id=0)
void operator=(const buffer &)=delete
virtual FMT_CONSTEXPR20 void grow(size_t capacity)=0
constexpr FMT_INLINE auto const_check(T value) -> T
FMT_CONSTEXPR auto locale() -> detail::locale_ref
FMT_CONSTEXPR void on_auto()
auto count() const -> size_t
FMT_CONSTEXPR FMT_INLINE value(basic_string_view< char_type > val)
T args_[1+(NUM_ARGS!=0?NUM_ARGS:+1)]
auto limit(size_t size) -> size_t
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
constexpr auto begin() const noexcept-> iterator
constexpr auto operator[](size_t pos) const noexcept-> const Char &
FMT_CONSTEXPR20 void grow(size_t) override
#define FMT_MODULE_EXPORT
std::integral_constant< bool, B > bool_constant
FMT_NODISCARD FMT_INLINE auto formatted_size(format_string< T...> fmt, T &&...args) -> size_t
PXR_NAMESPACE_OPEN_SCOPE typedef unsigned char uchar
FMT_CONSTEXPR FMT_INLINE auto map(const T(&values)[N]) -> const T(&)[N]
constexpr auto capacity() const noexcept-> size_t
constexpr basic_format_context(OutputIt out, format_args ctx_args, detail::locale_ref loc={})
FMT_CONSTEXPR FMT_INLINE auto map(short val) -> int
FMT_CONSTEXPR FMT_INLINE auto do_map(T &&) -> unformattable
constexpr FMT_INLINE value(bool val)
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
constexpr auto count_named_args() -> size_t
FMT_CONSTEXPR FMT_INLINE auto parse_arg_id(const Char *begin, const Char *end, Handler &&handler) -> const Char *
FMT_CONSTEXPR20 buffer(T *p=nullptr, size_t sz=0, size_t cap=0) noexcept
#define FMT_FORMAT_AS(Type, Base)
FMT_INLINE value(int128_opt val)
friend auto operator<(basic_string_view lhs, basic_string_view rhs) -> bool
FMT_CONSTEXPR FMT_INLINE arg_data(const U &...init)
FMT_INLINE auto begin() const noexcept-> const T *
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.