17 #include <type_traits> 21 #define FMT_VERSION 70103 24 # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) 26 # define FMT_CLANG_VERSION 0 29 #if defined(__GNUC__) && !defined(__clang__) 30 # define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 32 # define FMT_GCC_VERSION 0 35 #if defined(__INTEL_COMPILER) 36 # define FMT_ICC_VERSION __INTEL_COMPILER 38 # define FMT_ICC_VERSION 0 41 #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) 42 # define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION 44 # define FMT_HAS_GXX_CXX11 0 48 # define FMT_NVCC __NVCC__ 54 # define FMT_MSC_VER _MSC_VER 55 # define FMT_SUPPRESS_MSC_WARNING(n) __pragma(warning(suppress : n)) 57 # define FMT_MSC_VER 0 58 # define FMT_SUPPRESS_MSC_WARNING(n) 62 # define FMT_HAS_FEATURE(x) __has_feature(x) 64 # define FMT_HAS_FEATURE(x) 0 67 #if defined(__has_include) && !defined(__INTELLISENSE__) && \ 68 (!FMT_ICC_VERSION || FMT_ICC_VERSION >= 1600) 69 # define FMT_HAS_INCLUDE(x) __has_include(x) 71 # define FMT_HAS_INCLUDE(x) 0 74 #ifdef __has_cpp_attribute 75 # define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) 77 # define FMT_HAS_CPP_ATTRIBUTE(x) 0 80 #define FMT_HAS_CPP14_ATTRIBUTE(attribute) \ 81 (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute)) 83 #define FMT_HAS_CPP17_ATTRIBUTE(attribute) \ 84 (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute)) 88 #ifndef FMT_USE_CONSTEXPR 89 # define FMT_USE_CONSTEXPR \ 90 (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \ 91 (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \ 92 !FMT_NVCC && !FMT_ICC_VERSION 95 # define FMT_CONSTEXPR constexpr 96 # define FMT_CONSTEXPR_DECL constexpr 98 # define FMT_CONSTEXPR inline 99 # define FMT_CONSTEXPR_DECL 103 # if FMT_HAS_FEATURE(cxx_override_control) || \ 104 (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 105 # define FMT_OVERRIDE override 107 # define FMT_OVERRIDE 112 #ifndef FMT_EXCEPTIONS 113 # if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \ 114 FMT_MSC_VER && !_HAS_EXCEPTIONS 115 # define FMT_EXCEPTIONS 0 117 # define FMT_EXCEPTIONS 1 122 #ifndef FMT_USE_NOEXCEPT 123 # define FMT_USE_NOEXCEPT 0 126 #if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \ 127 (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 128 # define FMT_DETECTED_NOEXCEPT noexcept 129 # define FMT_HAS_CXX11_NOEXCEPT 1 131 # define FMT_DETECTED_NOEXCEPT throw() 132 # define FMT_HAS_CXX11_NOEXCEPT 0 136 # if FMT_EXCEPTIONS || FMT_HAS_CXX11_NOEXCEPT 137 # define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT 139 # define FMT_NOEXCEPT 145 #if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && \ 147 # define FMT_NORETURN [[noreturn]] 149 # define FMT_NORETURN 152 #ifndef FMT_DEPRECATED 153 # if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900 154 # define FMT_DEPRECATED [[deprecated]] 156 # if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__) 157 # define FMT_DEPRECATED __attribute__((deprecated)) 159 # define FMT_DEPRECATED __declspec(deprecated) 161 # define FMT_DEPRECATED 167 #if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC 168 # define FMT_DEPRECATED_ALIAS 170 # define FMT_DEPRECATED_ALIAS FMT_DEPRECATED 174 # if FMT_GCC_VERSION || FMT_CLANG_VERSION 175 # define FMT_INLINE inline __attribute__((always_inline)) 177 # define FMT_INLINE inline 181 #ifndef FMT_USE_INLINE_NAMESPACES 182 # if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ 183 (FMT_MSC_VER >= 1900 && !_MANAGED) 184 # define FMT_USE_INLINE_NAMESPACES 1 186 # define FMT_USE_INLINE_NAMESPACES 0 190 #ifndef FMT_BEGIN_NAMESPACE 191 # if FMT_USE_INLINE_NAMESPACES 192 # define FMT_INLINE_NAMESPACE inline namespace 193 # define FMT_END_NAMESPACE \ 197 # define FMT_INLINE_NAMESPACE namespace 198 # define FMT_END_NAMESPACE \ 200 using namespace v7; \ 203 # define FMT_BEGIN_NAMESPACE \ 205 FMT_INLINE_NAMESPACE v7 { 208 #if !defined(FMT_HEADER_ONLY) && defined(_WIN32) 209 # define FMT_CLASS_API FMT_SUPPRESS_MSC_WARNING(4275) 211 # define FMT_API __declspec(dllexport) 212 # define FMT_EXTERN_TEMPLATE_API FMT_API 213 # define FMT_EXPORTED 214 # elif defined(FMT_SHARED) 215 # define FMT_API __declspec(dllimport) 216 # define FMT_EXTERN_TEMPLATE_API FMT_API 219 # define FMT_CLASS_API 224 #ifndef FMT_EXTERN_TEMPLATE_API 225 # define FMT_EXTERN_TEMPLATE_API 227 #ifndef FMT_INSTANTIATION_DEF_API 228 # define FMT_INSTANTIATION_DEF_API FMT_API 231 #ifndef FMT_HEADER_ONLY 232 # define FMT_EXTERN extern 238 #if (FMT_HAS_INCLUDE(<string_view>) && \ 239 (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \ 240 (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) 241 # include <string_view> 242 # define FMT_USE_STRING_VIEW 243 #elif FMT_HAS_INCLUDE("experimental/string_view") && __cplusplus >= 201402L 244 # include <experimental/string_view> 245 # define FMT_USE_EXPERIMENTAL_STRING_VIEW 249 # define FMT_UNICODE !FMT_MSC_VER 251 #if FMT_UNICODE && FMT_MSC_VER 252 # pragma execution_character_set("utf-8") 258 template <
bool B,
class T =
void>
260 template <
bool B,
class T,
class F>
263 template <
typename T>
265 template <
typename T>
267 template <
typename T>
277 #define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0 285 const char* message);
290 # define FMT_ASSERT(condition, message) ((void)0) 292 # define FMT_ASSERT(condition, message) \ 295 : ::fmt::detail::assert_fail(__FILE__, __LINE__, (message))) 299 #if defined(FMT_USE_STRING_VIEW) 300 template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
301 #elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW) 302 template <
typename Char>
303 using std_string_view = std::experimental::basic_string_view<Char>;
308 #ifdef FMT_USE_INT128 310 #elif defined(__SIZEOF_INT128__) && !FMT_NVCC && \ 311 !(FMT_CLANG_VERSION && FMT_MSC_VER) 312 # define FMT_USE_INT128 1 316 # define FMT_USE_INT128 0 324 template <
typename Int>
334 (
sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5);
344 #ifdef FMT_USE_INTERNAL 345 namespace internal =
detail;
377 #if __cplusplus >= 201703L // C++17's char_traits::length() is constexpr. 381 : data_(s), size_(std::char_traits<Char>::length(s)) {}
384 template <
typename Traits,
typename Alloc>
386 const std::basic_string<Char, Traits, Alloc>& s)
FMT_NOEXCEPT 396 constexpr
const Char*
data()
const {
return data_; }
399 constexpr
size_t size()
const {
return size_; }
404 constexpr
const Char&
operator[](
size_t pos)
const {
return data_[pos]; }
413 size_t str_size = size_ < other.
size_ ? size_ : other.
size_;
414 int result = std::char_traits<Char>::compare(data_, other.
data_, str_size);
416 result = size_ == other.
size_ ? 0 : (size_ < other.
size_ ? -1 : 1);
444 template <
typename T>
struct is_char : std::false_type {};
445 template <>
struct is_char<char> : std::true_type {};
446 template <>
struct is_char<wchar_t> : std::true_type {};
448 template <>
struct is_char<char16_t> : std::true_type {};
449 template <>
struct is_char<char32_t> : std::true_type {};
467 template <typename Char, FMT_ENABLE_IF(is_char<Char>::value)>
472 template <
typename Char,
typename Traits,
typename Alloc>
474 const std::basic_string<Char, Traits, Alloc>& s) {
478 template <
typename Char>
483 template <
typename Char,
493 template <
typename S>
496 template <typename S, FMT_ENABLE_IF(is_compile_string<S>::value)>
508 template <
typename S>
509 struct is_string : std::is_class<decltype(to_string_view(std::declval<S>()))> {
521 #ifdef FMT_ENFORCE_COMPILE_STRING 523 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use " 558 template <
typename Char,
typename ErrorHandler = detail::error_handler>
571 : ErrorHandler(eh), format_str_(format_str), next_arg_id_(next_arg_id) {}
596 if (next_arg_id_ >= 0)
return next_arg_id_++;
597 on_error(
"cannot switch from manual to automatic argument indexing");
606 if (next_arg_id_ > 0)
607 on_error(
"cannot switch from automatic to manual argument indexing");
615 ErrorHandler::on_error(message);
629 template <
typename T,
typename Char =
char,
typename Enable =
void>
637 template <
typename T,
typename Context>
639 std::is_constructible<typename Context::template formatter_type<T>>;
643 template <
typename Char>
649 template <
typename Container>
651 using bi_iterator = std::back_insert_iterator<Container>;
652 struct accessor : bi_iterator {
653 accessor(bi_iterator iter) : bi_iterator(iter) {}
654 using bi_iterator::container;
656 return *accessor(it).container;
686 capacity_ = buf_capacity;
690 virtual void grow(
size_t capacity) = 0;
697 void operator=(
const buffer&) =
delete;
724 size_ = count <= capacity_ ?
count : capacity_;
732 if (new_capacity > capacity_) grow(new_capacity);
736 try_reserve(size_ + 1);
737 ptr_[size_++] = value;
741 template <
typename U>
void append(
const U* begin,
const U* end);
743 template <
typename I> T&
operator[](I index) {
return ptr_[index]; }
752 size_t limit(
size_t size) {
return size; }
762 size_t count()
const {
return count_; }
764 size_t n = limit_ > count_ ? limit_ - count_ : 0;
766 return size < n ? size : n;
771 template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
775 enum { buffer_size = 256 };
776 T data_[buffer_size];
780 if (this->size() == buffer_size) flush();
787 buffer<T>(data_, 0, buffer_size),
805 T*
out() {
return &*this->end(); }
809 template <
typename Container>
812 typename Container::value_type>>
813 final :
public buffer<typename Container::value_type> {
819 container_.resize(capacity);
820 this->
set(&container_[0], capacity);
828 std::back_insert_iterator<Container>
out() {
829 return std::back_inserter(container_);
836 enum { buffer_size = 256 };
837 T data_[buffer_size];
842 if (this->size() != buffer_size)
return;
843 count_ += this->size();
850 size_t count() {
return count_ + this->size(); }
855 template <
typename T>
857 using base = std::back_insert_iterator<buffer<T>>;
876 template <
typename T,
typename OutputIt>
887 template <
typename Buffer>
895 template <
typename T,
typename Char =
char,
typename Enable =
void>
901 template <
typename T,
typename Context>
903 std::is_constructible<fallback_formatter<T, typename Context::char_type>>;
910 named_arg(
const Char* n,
const T& v) : name(n), value(v) {}
918 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
922 T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
925 template <
typename... U>
926 arg_data(
const U&... init) : args_{T(named_args_, NUM_NAMED_ARGS), init...} {}
928 const T*
args()
const {
return args_ + 1; }
932 template <
typename T,
typename Char,
size_t NUM_ARGS>
935 T args_[NUM_ARGS != 0 ? NUM_ARGS : +1];
937 template <
typename... U>
943 template <
typename Char>
946 template <
typename Char,
typename T,
typename... Tail>
948 int named_arg_count,
const T&,
const Tail&... args) {
952 template <
typename Char,
typename T,
typename... Tail>
955 const Tail&... args) {
956 named_args[named_arg_count++] = {arg.
name, arg_count};
960 template <
typename... Args>
965 template <
typename T,
typename Char>
968 template <
bool B = false> constexpr
size_t count() {
return B ? 1 : 0; }
969 template <
bool B1,
bool B2,
bool... Tail> constexpr
size_t count() {
970 return (B1 ? 1 : 0) +
count<B2, Tail...>();
974 return count<is_named_arg<Args>::value...>();
1001 template <
typename T,
typename Char>
1004 #define FMT_TYPE_CONSTANT(Type, constant) \ 1005 template <typename Char> \ 1006 struct type_constant<Type, Char> \ 1007 : std::integral_constant<type, type::constant> {} 1025 return t > type::none_type && t <= type::last_integer_type;
1029 return t > type::none_type && t <= type::last_numeric_type;
1049 template <
typename Context>
class value {
1084 string.data = val.
data();
1085 string.size = val.
size();
1089 : named_args{args, size} {}
1092 custom.value = &val;
1096 custom.format = format_custom_arg<
1098 typename Context::template formatter_type<T>,
1104 template <
typename T,
typename Formatter>
1106 typename Context::parse_context_type& parse_ctx,
1109 parse_ctx.advance_to(f.parse(parse_ctx));
1110 ctx.advance_to(f.format(*static_cast<const T*>(arg), ctx));
1114 template <
typename Context,
typename T>
1143 template <typename T, FMT_ENABLE_IF(is_char<T>::value)>
1146 std::is_same<T, char>::value || std::is_same<T, char_type>::value,
1147 "mixing character types is disallowed");
1157 template <typename T, FMT_ENABLE_IF(is_string<T>::value)>
1160 "mixing character types is disallowed");
1163 template <
typename T,
1182 static_assert(std::is_same<char_type, char>::value,
"invalid string type");
1183 return reinterpret_cast<const char*
>(val);
1186 static_assert(std::is_same<char_type, char>::value,
"invalid string type");
1187 return reinterpret_cast<const char*
>(val);
1190 const auto* const_val = val;
1191 return map(const_val);
1194 const auto* const_val = val;
1195 return map(const_val);
1206 static_assert(!
sizeof(T),
"formatting of non-void pointers is disallowed");
1210 template <
typename T,
1215 -> decltype(std::declval<arg_mapper>().map(
1219 template <
typename T,
1227 template <
typename T>
1229 -> decltype(std::declval<arg_mapper>().map(val.value)) {
1230 return map(val.value);
1237 template <
typename T,
typename Context>
1240 typename Context::char_type>;
1256 template <
typename ContextType,
typename T>
1260 template <
typename Visitor,
typename Ctx>
1263 -> decltype(vis(0));
1270 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1274 : value_(args, size) {}
1281 void format(
typename Context::parse_context_type& parse_ctx,
1282 Context& ctx)
const {
1283 custom_.format(custom_.value, parse_ctx, ctx);
1309 template <
typename Visitor,
typename Context>
1312 using char_type =
typename Context::char_type;
1313 switch (
arg.type_) {
1317 return vis(
arg.value_.int_value);
1319 return vis(
arg.value_.uint_value);
1321 return vis(
arg.value_.long_long_value);
1323 return vis(
arg.value_.ulong_long_value);
1326 return vis(
arg.value_.int128_value);
1328 return vis(
arg.value_.uint128_value);
1335 return vis(
arg.value_.bool_value);
1337 return vis(
arg.value_.char_value);
1339 return vis(
arg.value_.float_value);
1341 return vis(
arg.value_.double_value);
1343 return vis(
arg.value_.long_double_value);
1345 return vis(
arg.value_.string.data);
1348 arg.value_.string.size));
1350 return vis(
arg.value_.pointer);
1363 template <
typename... Ts>
1366 template <
typename It,
typename T,
typename Enable =
void>
1369 template <
typename It,
typename T>
1372 void_t<typename std::iterator_traits<It>::iterator_category,
1373 decltype(*std::declval<It>() = std::declval<T>())>>
1374 : std::true_type {};
1376 template <
typename OutputIt>
1378 template <
typename Container>
1380 : std::true_type {};
1382 template <
typename OutputIt>
1384 template <
typename Container>
1387 template <
typename Char>
1389 : std::true_type {};
1398 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1402 template <
typename Locale> Locale
get()
const;
1405 template <
typename> constexpr
unsigned long long encode_types() {
return 0; }
1407 template <
typename Context,
typename Arg,
typename... Args>
1413 template <
typename Context,
typename T>
1424 "Cannot format an argument. To make type T formattable provide a " 1425 "formatter<T> specialization: https://fmt.dev/latest/api.html#udt");
1428 template <
typename T,
typename U>
inline const U&
check(
const U& val) {
1435 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1441 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1444 return make_arg<Context>(value);
1448 template <
typename T>
1451 template <
typename T>
const T&
unwrap(
const T& v) {
return v; }
1452 template <
typename T>
const T&
unwrap(
const std::reference_wrapper<T>& v) {
1453 return static_cast<const T&
>(v);
1460 template <
typename =
void>
struct node {
1461 virtual ~
node() =
default;
1468 template <
typename Arg>
1471 template <
typename Char>
1473 : value(arg.
data(), arg.size()) {}
1479 template <
typename T,
typename Arg>
const T&
push(
const Arg&
arg) {
1481 auto& value = new_node->value;
1482 new_node->next = std::move(head_);
1483 head_ = std::move(new_node);
1515 : out_(out), args_(ctx_args), loc_(loc) {}
1523 void on_error(
const char* message) { error_handler().on_error(message); }
1536 template <
typename Char>
1543 #define FMT_BUFFER_CONTEXT(Char) \ 1544 basic_format_context<detail::buffer_appender<Char>, Char> 1553 template <
typename Context,
typename... Args>
1574 static constexpr
unsigned long long desc =
1577 (num_named_args != 0
1604 const Args&... args) {
1616 template <
typename... Args,
typename S,
typename Char =
char_t<S>>
1623 std::is_reference<Args>::value)...>() == 0,
1624 "passing views as lvalues is disallowed");
1639 template <
typename Char,
typename T>
1655 template <
typename Context>
1657 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
1671 std::is_same<T, basic_string_view<char_type>>::value ||
1672 std::is_same<T, detail::std_string_view<char_type>>::value ||
1679 template <
typename T>
1681 std::basic_string<char_type>, T>;
1684 std::vector<basic_format_arg<Context>>
data_;
1695 (named_info_.empty()
1701 return named_info_.empty() ? data_.data() : data_.data() + 1;
1705 data_.emplace_back(detail::make_arg<Context>(arg));
1708 template <
typename T>
1710 if (named_info_.empty()) {
1712 data_.insert(data_.begin(), {zero_ptr, 0});
1715 auto pop_one = [](std::vector<basic_format_arg<Context>>* data) {
1718 std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
1719 guard{&data_, pop_one};
1720 named_info_.push_back({arg.
name,
static_cast<int>(data_.size() - 2u)});
1721 data_[0].value_.named_args = {named_info_.data(), named_info_.size()};
1776 "objects of built-in types and string views are always copied");
1777 emplace_arg(arg.get());
1785 template <
typename T>
1788 dynamic_args_.
push<std::basic_string<char_type>>(arg.
name).c_str();
1800 named_info_.clear();
1810 void reserve(
size_t new_cap,
size_t new_cap_named) {
1812 "Set of arguments includes set of named arguments");
1813 data_.reserve(new_cap);
1814 named_info_.reserve(new_cap_named);
1857 return static_cast<detail::type>((desc_ >> shift) & mask);
1862 : desc_(desc), values_(values) {}
1864 : desc_(desc), args_(args) {}
1874 template <
typename... Args>
1876 : basic_format_args(store.desc, store.data_.args()) {}
1885 : basic_format_args(store.get_types(), store.data()) {}
1900 if (
id < max_size()) arg = args_[
id];
1906 arg.
value_ = values_[id];
1911 int id = get_id(name);
1916 if (!has_named_args())
return -1;
1917 const auto& named_args =
1918 (is_packed() ? values_[-1] : args_[-1].value_).named_args;
1919 for (
size_t i = 0; i < named_args.size; ++i) {
1920 if (named_args.data[i].name == name)
return named_args.data[i].id;
1927 return static_cast<int>(is_packed() ? max_packed
1932 #ifdef FMT_ARM_ABI_COMPATIBILITY 1942 template <
typename... Args>
1952 template <typename Char, FMT_ENABLE_IF(!std::is_same<Char, char>::value)>
1953 std::basic_string<Char>
vformat(
1959 template <
typename Char>
1965 template <
typename Char,
typename Args,
1978 template <
typename OutputIt,
typename S,
typename Char =
char_t<S>,
1979 bool enable = detail::is_output_iterator<OutputIt, Char>::value>
2000 template <
typename OutputIt,
typename S,
typename... Args,
2002 inline auto format_to(OutputIt out,
const S& format_str, Args&&... args) ->
2015 template <
typename OutputIt,
typename Char,
typename... Args,
2033 template <
typename OutputIt,
typename S,
typename... Args,
2036 const Args&... args) ->
2037 typename std::enable_if<enable, format_to_n_result<OutputIt>>
::type {
2046 template <
typename... Args>
2054 template <
typename S,
typename Char =
char_t<S>>
2056 const S& format_str,
2073 template <
typename S,
typename... Args,
typename Char =
char_t<S>>
2093 template <
typename S,
typename... Args,
typename Char =
char_t<S>>
2094 inline void print(std::FILE* f,
const S& format_str, Args&&... args) {
2096 return detail::is_unicode<Char>()
2112 template <
typename S,
typename... Args,
typename Char =
char_t<S>>
2113 inline void print(
const S& format_str, Args&&... args) {
2115 return detail::is_unicode<Char>()
2122 #endif // FMT_CORE_H_
FMT_CONSTEXPR typed_node(const Arg &arg)
#define FMT_BEGIN_NAMESPACE
basic_string_view< Char > to_string_view(const Char *s)
constexpr size_t size() const
#define FMT_ASSERT(condition, message)
format_arg arg(int id) const
long long long_long_value
conditional_t< long_short, int, long long > long_type
basic_format_context(OutputIt out, basic_format_args< basic_format_context > ctx_args, detail::locale_ref loc=detail::locale_ref())
size_t limit(size_t size)
FMT_INLINE value(const T &val)
auto make_args_checked(const S &format_str, const remove_reference_t< Args > &... args) -> format_arg_store< buffer_context< Char >, remove_reference_t< Args >... >
FMT_INLINE value(char_type val)
FMT_CONSTEXPR typed_node(const basic_string_view< Char > &arg)
void on_error(const char *message)
static void format_custom_arg(const void *arg, typename Context::parse_context_type &parse_ctx, Context &ctx)
void grow(size_t) final FMT_OVERRIDE
FMT_CONSTEXPR int map(short val)
FMT_CONSTEXPR void remove_prefix(size_t n)
void format_arg(basic_format_parse_context< typename Context::char_type > &parse_ctx, Context &ctx, Id arg_id)
const T * data() const FMT_NOEXCEPT
FMT_CONSTEXPR const char * map(unsigned char *val)
buffer_context< char > format_context
FMT_CONSTEXPR int map(signed char val)
typename Context::char_type char_type
size_t limit(size_t size)
const T * end() const FMT_NOEXCEPT
void vformat_to(buffer< Char > &buf, const text_style &ts, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
void grow(size_t) final FMT_OVERRIDE
FMT_INLINE value(double val)
friend bool operator==(basic_string_view lhs, basic_string_view rhs)
FMT_CONSTEXPR const void * map(const void *val)
#define FMT_SUPPRESS_MSC_WARNING(n)
constexpr FMT_INLINE value(int val=0)
std::is_constructible< typename Context::template formatter_type< T > > has_formatter
typename basic_format_context ::char_type char_type
auto vformat_to(OutputIt out, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args) -> typename std::enable_if< enable, OutputIt >::type
#define FMT_BUFFER_CONTEXT(Char)
FMT_CONSTEXPR const void * map(std::nullptr_t val)
void advance_to(iterator it)
friend bool operator<(basic_string_view lhs, basic_string_view rhs)
buffer< T > & get_buffer(buffer_appender< T >)
FMT_CONSTEXPR void on_error(const char *message)
void push_back(const T &value)
typename type_identity< T >::type type_identity_t
basic_format_args< basic_format_context > args_
FMT_INLINE value(const void *val)
conditional_t< long_short, unsigned, unsigned long long > ulong_type
constexpr const Char & operator[](size_t pos) const
FMT_CONSTEXPR long long map(long long val)
FMT_CONSTEXPR unsigned map(unsigned char val)
FMT_CONSTEXPR void check_arg_id(int)
std::basic_string< Char > vformat(basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
constexpr bool is_unicode()
constexpr bool is_integral_type(type t)
const T * begin() const FMT_NOEXCEPT
arg_data(const U &... init)
#define FMT_CONSTEXPR_DECL
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
FMT_CONSTEXPR ulong_type map(unsigned long val)
typename basic_format_context ::parse_context_type parse_context
std::is_constructible< fallback_formatter< T, typename Context::char_type > > has_fallback_formatter
buffer_appender(buffer< T > &buf)
FMT_CONSTEXPR basic_string_view(const std::basic_string< Char, Traits, Alloc > &s) FMT_NOEXCEPT
FMT_CONSTEXPR char_type map(T val)
const T & unwrap(const std::reference_wrapper< T > &v)
FMT_CONSTEXPR float map(float val)
FMT_CONSTEXPR const char_type * map(const char_type *val)
void vprint_mojibake(std::FILE *, basic_string_view< Char >, const Args &)
void print(std::FILE *f, const S &format_str, Args &&... args)
FMT_CONSTEXPR auto map(const named_arg< char_type, T > &val) -> decltype(std::declval< arg_mapper >().map(val.value))
auto format_to_n(OutputIt out, size_t n, const S &format_str, const Args &... args) -> typename std::enable_if< enable, format_to_n_result< OutputIt >>::type
FMT_CONSTEXPR int next_arg_id()
constexpr const Char * data() const
void check_format_string(S)
void init_named_args(named_arg_info< Char > *, int, int)
size_t capacity() const FMT_NOEXCEPT
buffer(T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT
FMT_CONSTEXPR auto map(const T &val) -> decltype(std::declval< arg_mapper >().map(static_cast< typename std::underlying_type< T >::type >(val)))
long double long_double_value
#define FMT_END_NAMESPACE
iterator_buffer(T *out, size_t=0)
format_arg arg(basic_string_view< char_type > name)
FMT_INLINE value(uint128_t val)
FMT_CONSTEXPR const char * map(const signed char *val)
FMT_CONSTEXPR uint128_t map(uint128_t val)
detail::locale_ref locale()
constexpr basic_format_parse_context(basic_string_view< Char > format_str, ErrorHandler eh={}, int next_arg_id=0)
typename std::enable_if< B, T >::type enable_if_t
FMT_CONSTEXPR long double map(long double val)
std::unique_ptr< node<> > next
void grow(size_t capacity) final FMT_OVERRIDE
buffer_appender operator++(int)
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
FMT_INLINE value(basic_string_view< char_type > val)
format_to_n_result< OutputIt > vformat_to_n(OutputIt out, size_t n, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
FMT_CONSTEXPR unsigned long long map(unsigned long long val)
format_arg_store< Context, Args... > make_format_args(const Args &... args)
FMT_CONSTEXPR const char * map(const unsigned char *val)
const T & operator[](I index) const
decltype(to_string_view(std::declval< S >())) result
FMT_INLINE value(long double val)
fixed_buffer_traits(size_t limit)
const T & unwrap(const T &v)
#define FMT_ENABLE_IF(...)
FMT_CONSTEXPR long_type map(long val)
typename detail::char_t_impl< S >::type char_t
constexpr iterator begin() const
auto get_iterator(Buffer &buf) -> decltype(buf.out())
constexpr iterator end() const FMT_NOEXCEPT
constexpr unsigned long long encode_types()
unsigned long long ulong_long_value
typename std::conditional< B, T, F >::type conditional_t
typename result::value_type type
string_value< char_type > string
detail::error_handler error_handler()
typename std::remove_cv< remove_reference_t< T > >::type remove_cvref_t
FMT_INLINE value(unsigned long long val)
typename std::remove_reference< T >::type remove_reference_t
FMT_INLINE value(float val)
std::unique_ptr< node<> > head_
constexpr FMT_INLINE value(unsigned val)
FMT_INLINE value(const char_type *val)
named_arg_info< Char > * named_args()
FMT_CONSTEXPR int map(int val)
const U & check(const U &val)
named_arg_value< char_type > named_args
size_t size() const FMT_NOEXCEPT
FMT_CONSTEXPR unsigned map(unsigned short val)
FMT_CONSTEXPR basic_string_view(S s) FMT_NOEXCEPT
std::integral_constant< bool, B > bool_constant
FMT_CONSTEXPR const T & map(const T &val)
custom_value< Context > custom
void try_resize(size_t count)
constexpr basic_string_view(const Char *s, size_t count) FMT_NOEXCEPT
constexpr basic_string_view() FMT_NOEXCEPT
friend bool operator!=(basic_string_view lhs, basic_string_view rhs)
buffer_appender< T > get_iterator(buffer< T > &buf)
int compare(basic_string_view other) const
FMT_API void vprint(string_view, format_args)
FMT_INLINE std::basic_string< Char > vformat(const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
void try_reserve(size_t new_capacity)
FMT_INLINE value(long long val)
constexpr bool is_arithmetic_type(type t)
basic_string_view< Char > format_str_
std::back_insert_iterator< Container > out()
FMT_INLINE std::basic_string< Char > format(const S &format_str, Args &&... args)
const wchar_t & const_reference
int arg_id(basic_string_view< char_type > name)
remove_cvref_t< decltype(*std::declval< Range >().begin())> value_type
FMT_INLINE std::nullptr_t named_args()
FMT_CONSTEXPR void advance_to(iterator it)
typename detail::void_t_impl< Ts... >::type void_t
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
constexpr iterator end() const
iterator_buffer(OutputIt out, size_t n=buffer_size)
FMT_CONSTEXPR basic_format_arg< Context > make_arg(const T &value)
FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
constexpr unsigned long long encode_types()
OutputIt get_buffer_init(OutputIt out)
FMT_INLINE value(int128_t val)
const basic_format_args< basic_format_context > & args() const
FMT_CONSTEXPR int map(const T *)
detail::named_arg< Char, T > arg(const Char *name, const T &arg)
void grow(size_t) final FMT_OVERRIDE
FMT_INLINE void init_named_args(std::nullptr_t, int, int, const Args &...)
constexpr T const_check(T value)
typename std::remove_const< T >::type remove_const_t
Container & get_container(std::back_insert_iterator< Container > it)
named_arg(const Char *n, const T &v)
const named_arg_info< Char > * data
iterator_buffer(Container &c)
FMT_INLINE const T * args() const
friend bool operator>(basic_string_view lhs, basic_string_view rhs)
FMT_CONSTEXPR const void * map(void *val)
size_t formatted_size(string_view format_str, Args &&... args)
auto format_to(OutputIt out, const S &format_str, Args &&... args) -> typename std::enable_if< enable, OutputIt >::type
friend bool operator>=(basic_string_view lhs, basic_string_view rhs)
friend bool operator<=(basic_string_view lhs, basic_string_view rhs)
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
buffer< T > & get_buffer_init(buffer_appender< T > out)
constexpr size_t count_named_args()
constexpr ErrorHandler error_handler() const
buffer_appender & operator++()
constexpr iterator begin() const FMT_NOEXCEPT
FMT_CONSTEXPR const char * map(signed char *val)
FMT_INLINE value(bool val)
basic_string_view(const Char *s)
FMT_CONSTEXPR basic_string_view< char_type > map(const T &val)
FMT_INLINE void check_format_string(const S &)
FMT_INLINE arg_data(const U &... init)
FMT_CONSTEXPR double map(double val)
FMT_CONSTEXPR const char_type * map(char_type *val)
basic_format_arg< Context > make_arg(const T &value)
std::back_insert_iterator< buffer< T > > base
const T & push(const Arg &arg)
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
FMT_CONSTEXPR unsigned map(unsigned val)
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
FMT_CONSTEXPR int128_t map(int128_t val)
FMT_CONSTEXPR bool map(bool val)
typename basic_string_view< Char >::iterator iterator
#define FMT_TYPE_CONSTANT(Type, constant)