诸暨麻将添加redis
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

716 rindas
21 KiB

  1. // Formatting library for C++
  2. //
  3. // Copyright (c) 2012 - 2016, Victor Zverovich
  4. // All rights reserved.
  5. //
  6. // For the license information refer to format.h.
  7. #ifndef FMT_PRINTF_H_
  8. #define FMT_PRINTF_H_
  9. #include <algorithm> // std::fill_n
  10. #include <limits> // std::numeric_limits
  11. #include "ostream.h"
  12. FMT_BEGIN_NAMESPACE
  13. namespace internal {
  14. // A helper function to suppress bogus "conditional expression is constant"
  15. // warnings.
  16. template <typename T> inline T const_check(T value) { return value; }
  17. // Checks if a value fits in int - used to avoid warnings about comparing
  18. // signed and unsigned integers.
  19. template <bool IsSigned> struct int_checker {
  20. template <typename T> static bool fits_in_int(T value) {
  21. unsigned max = std::numeric_limits<int>::max();
  22. return value <= max;
  23. }
  24. static bool fits_in_int(bool) { return true; }
  25. };
  26. template <> struct int_checker<true> {
  27. template <typename T> static bool fits_in_int(T value) {
  28. return value >= std::numeric_limits<int>::min() &&
  29. value <= std::numeric_limits<int>::max();
  30. }
  31. static bool fits_in_int(int) { return true; }
  32. };
  33. class printf_precision_handler {
  34. public:
  35. template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
  36. int operator()(T value) {
  37. if (!int_checker<std::numeric_limits<T>::is_signed>::fits_in_int(value))
  38. FMT_THROW(format_error("number is too big"));
  39. return (std::max)(static_cast<int>(value), 0);
  40. }
  41. template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
  42. int operator()(T) {
  43. FMT_THROW(format_error("precision is not integer"));
  44. return 0;
  45. }
  46. };
  47. // An argument visitor that returns true iff arg is a zero integer.
  48. class is_zero_int {
  49. public:
  50. template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
  51. bool operator()(T value) {
  52. return value == 0;
  53. }
  54. template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
  55. bool operator()(T) {
  56. return false;
  57. }
  58. };
  59. template <typename T> struct make_unsigned_or_bool : std::make_unsigned<T> {};
  60. template <> struct make_unsigned_or_bool<bool> { using type = bool; };
  61. template <typename T, typename Context> class arg_converter {
  62. private:
  63. using char_type = typename Context::char_type;
  64. basic_format_arg<Context>& arg_;
  65. char_type type_;
  66. public:
  67. arg_converter(basic_format_arg<Context>& arg, char_type type)
  68. : arg_(arg), type_(type) {}
  69. void operator()(bool value) {
  70. if (type_ != 's') operator()<bool>(value);
  71. }
  72. template <typename U, FMT_ENABLE_IF(std::is_integral<U>::value)>
  73. void operator()(U value) {
  74. bool is_signed = type_ == 'd' || type_ == 'i';
  75. using target_type = conditional_t<std::is_same<T, void>::value, U, T>;
  76. if (const_check(sizeof(target_type) <= sizeof(int))) {
  77. // Extra casts are used to silence warnings.
  78. if (is_signed) {
  79. arg_ = internal::make_arg<Context>(
  80. static_cast<int>(static_cast<target_type>(value)));
  81. } else {
  82. using unsigned_type = typename make_unsigned_or_bool<target_type>::type;
  83. arg_ = internal::make_arg<Context>(
  84. static_cast<unsigned>(static_cast<unsigned_type>(value)));
  85. }
  86. } else {
  87. if (is_signed) {
  88. // glibc's printf doesn't sign extend arguments of smaller types:
  89. // std::printf("%lld", -42); // prints "4294967254"
  90. // but we don't have to do the same because it's a UB.
  91. arg_ = internal::make_arg<Context>(static_cast<long long>(value));
  92. } else {
  93. arg_ = internal::make_arg<Context>(
  94. static_cast<typename make_unsigned_or_bool<U>::type>(value));
  95. }
  96. }
  97. }
  98. template <typename U, FMT_ENABLE_IF(!std::is_integral<U>::value)>
  99. void operator()(U) {} // No conversion needed for non-integral types.
  100. };
  101. // Converts an integer argument to T for printf, if T is an integral type.
  102. // If T is void, the argument is converted to corresponding signed or unsigned
  103. // type depending on the type specifier: 'd' and 'i' - signed, other -
  104. // unsigned).
  105. template <typename T, typename Context, typename Char>
  106. void convert_arg(basic_format_arg<Context>& arg, Char type) {
  107. visit_format_arg(arg_converter<T, Context>(arg, type), arg);
  108. }
  109. // Converts an integer argument to char for printf.
  110. template <typename Context> class char_converter {
  111. private:
  112. basic_format_arg<Context>& arg_;
  113. public:
  114. explicit char_converter(basic_format_arg<Context>& arg) : arg_(arg) {}
  115. template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
  116. void operator()(T value) {
  117. arg_ = internal::make_arg<Context>(
  118. static_cast<typename Context::char_type>(value));
  119. }
  120. template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
  121. void operator()(T) {} // No conversion needed for non-integral types.
  122. };
  123. // Checks if an argument is a valid printf width specifier and sets
  124. // left alignment if it is negative.
  125. template <typename Char> class printf_width_handler {
  126. private:
  127. using format_specs = basic_format_specs<Char>;
  128. format_specs& specs_;
  129. public:
  130. explicit printf_width_handler(format_specs& specs) : specs_(specs) {}
  131. template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
  132. unsigned operator()(T value) {
  133. auto width = static_cast<uint32_or_64_t<T>>(value);
  134. if (internal::is_negative(value)) {
  135. specs_.align = align::left;
  136. width = 0 - width;
  137. }
  138. unsigned int_max = std::numeric_limits<int>::max();
  139. if (width > int_max) FMT_THROW(format_error("number is too big"));
  140. return static_cast<unsigned>(width);
  141. }
  142. template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
  143. unsigned operator()(T) {
  144. FMT_THROW(format_error("width is not integer"));
  145. return 0;
  146. }
  147. };
  148. template <typename Char, typename Context>
  149. void printf(buffer<Char>& buf, basic_string_view<Char> format,
  150. basic_format_args<Context> args) {
  151. Context(std::back_inserter(buf), format, args).format();
  152. }
  153. template <typename OutputIt, typename Char, typename Context>
  154. internal::truncating_iterator<OutputIt> printf(
  155. internal::truncating_iterator<OutputIt> it, basic_string_view<Char> format,
  156. basic_format_args<Context> args) {
  157. return Context(it, format, args).format();
  158. }
  159. } // namespace internal
  160. using internal::printf; // For printing into memory_buffer.
  161. template <typename Range> class printf_arg_formatter;
  162. template <typename OutputIt, typename Char> class basic_printf_context;
  163. /**
  164. \rst
  165. The ``printf`` argument formatter.
  166. \endrst
  167. */
  168. template <typename Range>
  169. class printf_arg_formatter : public internal::arg_formatter_base<Range> {
  170. public:
  171. using iterator = typename Range::iterator;
  172. private:
  173. using char_type = typename Range::value_type;
  174. using base = internal::arg_formatter_base<Range>;
  175. using context_type = basic_printf_context<iterator, char_type>;
  176. context_type& context_;
  177. void write_null_pointer(char) {
  178. this->specs()->type = 0;
  179. this->write("(nil)");
  180. }
  181. void write_null_pointer(wchar_t) {
  182. this->specs()->type = 0;
  183. this->write(L"(nil)");
  184. }
  185. public:
  186. using format_specs = typename base::format_specs;
  187. /**
  188. \rst
  189. Constructs an argument formatter object.
  190. *buffer* is a reference to the output buffer and *specs* contains format
  191. specifier information for standard argument types.
  192. \endrst
  193. */
  194. printf_arg_formatter(iterator iter, format_specs& specs, context_type& ctx)
  195. : base(Range(iter), &specs, internal::locale_ref()), context_(ctx) {}
  196. template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
  197. iterator operator()(T value) {
  198. // MSVC2013 fails to compile separate overloads for bool and char_type so
  199. // use std::is_same instead.
  200. if (std::is_same<T, bool>::value) {
  201. format_specs& fmt_specs = *this->specs();
  202. if (fmt_specs.type != 's') return base::operator()(value ? 1 : 0);
  203. fmt_specs.type = 0;
  204. this->write(value != 0);
  205. } else if (std::is_same<T, char_type>::value) {
  206. format_specs& fmt_specs = *this->specs();
  207. if (fmt_specs.type && fmt_specs.type != 'c')
  208. return (*this)(static_cast<int>(value));
  209. fmt_specs.sign = sign::none;
  210. fmt_specs.alt = false;
  211. fmt_specs.align = align::right;
  212. return base::operator()(value);
  213. } else {
  214. return base::operator()(value);
  215. }
  216. return this->out();
  217. }
  218. template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value)>
  219. iterator operator()(T value) {
  220. return base::operator()(value);
  221. }
  222. /** Formats a null-terminated C string. */
  223. iterator operator()(const char* value) {
  224. if (value)
  225. base::operator()(value);
  226. else if (this->specs()->type == 'p')
  227. write_null_pointer(char_type());
  228. else
  229. this->write("(null)");
  230. return this->out();
  231. }
  232. /** Formats a null-terminated wide C string. */
  233. iterator operator()(const wchar_t* value) {
  234. if (value)
  235. base::operator()(value);
  236. else if (this->specs()->type == 'p')
  237. write_null_pointer(char_type());
  238. else
  239. this->write(L"(null)");
  240. return this->out();
  241. }
  242. iterator operator()(basic_string_view<char_type> value) {
  243. return base::operator()(value);
  244. }
  245. iterator operator()(monostate value) { return base::operator()(value); }
  246. /** Formats a pointer. */
  247. iterator operator()(const void* value) {
  248. if (value) return base::operator()(value);
  249. this->specs()->type = 0;
  250. write_null_pointer(char_type());
  251. return this->out();
  252. }
  253. /** Formats an argument of a custom (user-defined) type. */
  254. iterator operator()(typename basic_format_arg<context_type>::handle handle) {
  255. handle.format(context_.parse_context(), context_);
  256. return this->out();
  257. }
  258. };
  259. template <typename T> struct printf_formatter {
  260. template <typename ParseContext>
  261. auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
  262. return ctx.begin();
  263. }
  264. template <typename FormatContext>
  265. auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) {
  266. internal::format_value(internal::get_container(ctx.out()), value);
  267. return ctx.out();
  268. }
  269. };
  270. /** This template formats data and writes the output to a writer. */
  271. template <typename OutputIt, typename Char> class basic_printf_context {
  272. public:
  273. /** The character type for the output. */
  274. using char_type = Char;
  275. using format_arg = basic_format_arg<basic_printf_context>;
  276. template <typename T> using formatter_type = printf_formatter<T>;
  277. private:
  278. using format_specs = basic_format_specs<char_type>;
  279. OutputIt out_;
  280. basic_format_args<basic_printf_context> args_;
  281. basic_parse_context<Char> parse_ctx_;
  282. static void parse_flags(format_specs& specs, const Char*& it,
  283. const Char* end);
  284. // Returns the argument with specified index or, if arg_index is equal
  285. // to the maximum unsigned value, the next argument.
  286. format_arg get_arg(unsigned arg_index = std::numeric_limits<unsigned>::max());
  287. // Parses argument index, flags and width and returns the argument index.
  288. unsigned parse_header(const Char*& it, const Char* end, format_specs& specs);
  289. public:
  290. /**
  291. \rst
  292. Constructs a ``printf_context`` object. References to the arguments and
  293. the writer are stored in the context object so make sure they have
  294. appropriate lifetimes.
  295. \endrst
  296. */
  297. basic_printf_context(OutputIt out, basic_string_view<char_type> format_str,
  298. basic_format_args<basic_printf_context> args)
  299. : out_(out), args_(args), parse_ctx_(format_str) {}
  300. OutputIt out() { return out_; }
  301. void advance_to(OutputIt it) { out_ = it; }
  302. format_arg arg(unsigned id) const { return args_.get(id); }
  303. basic_parse_context<Char>& parse_context() { return parse_ctx_; }
  304. FMT_CONSTEXPR void on_error(const char* message) {
  305. parse_ctx_.on_error(message);
  306. }
  307. /** Formats stored arguments and writes the output to the range. */
  308. template <typename ArgFormatter =
  309. printf_arg_formatter<internal::buffer_range<Char>>>
  310. OutputIt format();
  311. };
  312. template <typename OutputIt, typename Char>
  313. void basic_printf_context<OutputIt, Char>::parse_flags(format_specs& specs,
  314. const Char*& it,
  315. const Char* end) {
  316. for (; it != end; ++it) {
  317. switch (*it) {
  318. case '-':
  319. specs.align = align::left;
  320. break;
  321. case '+':
  322. specs.sign = sign::plus;
  323. break;
  324. case '0':
  325. specs.fill[0] = '0';
  326. break;
  327. case ' ':
  328. specs.sign = sign::space;
  329. break;
  330. case '#':
  331. specs.alt = true;
  332. break;
  333. default:
  334. return;
  335. }
  336. }
  337. }
  338. template <typename OutputIt, typename Char>
  339. typename basic_printf_context<OutputIt, Char>::format_arg
  340. basic_printf_context<OutputIt, Char>::get_arg(unsigned arg_index) {
  341. if (arg_index == std::numeric_limits<unsigned>::max())
  342. arg_index = parse_ctx_.next_arg_id();
  343. else
  344. parse_ctx_.check_arg_id(--arg_index);
  345. return internal::get_arg(*this, arg_index);
  346. }
  347. template <typename OutputIt, typename Char>
  348. unsigned basic_printf_context<OutputIt, Char>::parse_header(
  349. const Char*& it, const Char* end, format_specs& specs) {
  350. unsigned arg_index = std::numeric_limits<unsigned>::max();
  351. char_type c = *it;
  352. if (c >= '0' && c <= '9') {
  353. // Parse an argument index (if followed by '$') or a width possibly
  354. // preceded with '0' flag(s).
  355. internal::error_handler eh;
  356. unsigned value = parse_nonnegative_int(it, end, eh);
  357. if (it != end && *it == '$') { // value is an argument index
  358. ++it;
  359. arg_index = value;
  360. } else {
  361. if (c == '0') specs.fill[0] = '0';
  362. if (value != 0) {
  363. // Nonzero value means that we parsed width and don't need to
  364. // parse it or flags again, so return now.
  365. specs.width = value;
  366. return arg_index;
  367. }
  368. }
  369. }
  370. parse_flags(specs, it, end);
  371. // Parse width.
  372. if (it != end) {
  373. if (*it >= '0' && *it <= '9') {
  374. internal::error_handler eh;
  375. specs.width = parse_nonnegative_int(it, end, eh);
  376. } else if (*it == '*') {
  377. ++it;
  378. specs.width = visit_format_arg(
  379. internal::printf_width_handler<char_type>(specs), get_arg());
  380. }
  381. }
  382. return arg_index;
  383. }
  384. template <typename OutputIt, typename Char>
  385. template <typename ArgFormatter>
  386. OutputIt basic_printf_context<OutputIt, Char>::format() {
  387. auto out = this->out();
  388. const Char* start = parse_ctx_.begin();
  389. const Char* end = parse_ctx_.end();
  390. auto it = start;
  391. while (it != end) {
  392. char_type c = *it++;
  393. if (c != '%') continue;
  394. if (it != end && *it == c) {
  395. out = std::copy(start, it, out);
  396. start = ++it;
  397. continue;
  398. }
  399. out = std::copy(start, it - 1, out);
  400. format_specs specs;
  401. specs.align = align::right;
  402. // Parse argument index, flags and width.
  403. unsigned arg_index = parse_header(it, end, specs);
  404. // Parse precision.
  405. if (it != end && *it == '.') {
  406. ++it;
  407. c = it != end ? *it : 0;
  408. if ('0' <= c && c <= '9') {
  409. internal::error_handler eh;
  410. specs.precision = static_cast<int>(parse_nonnegative_int(it, end, eh));
  411. } else if (c == '*') {
  412. ++it;
  413. specs.precision =
  414. visit_format_arg(internal::printf_precision_handler(), get_arg());
  415. } else {
  416. specs.precision = 0;
  417. }
  418. }
  419. format_arg arg = get_arg(arg_index);
  420. if (specs.alt && visit_format_arg(internal::is_zero_int(), arg))
  421. specs.alt = false;
  422. if (specs.fill[0] == '0') {
  423. if (arg.is_arithmetic())
  424. specs.align = align::numeric;
  425. else
  426. specs.fill[0] = ' '; // Ignore '0' flag for non-numeric types.
  427. }
  428. // Parse length and convert the argument to the required type.
  429. c = it != end ? *it++ : 0;
  430. char_type t = it != end ? *it : 0;
  431. using internal::convert_arg;
  432. switch (c) {
  433. case 'h':
  434. if (t == 'h') {
  435. ++it;
  436. t = it != end ? *it : 0;
  437. convert_arg<signed char>(arg, t);
  438. } else {
  439. convert_arg<short>(arg, t);
  440. }
  441. break;
  442. case 'l':
  443. if (t == 'l') {
  444. ++it;
  445. t = it != end ? *it : 0;
  446. convert_arg<long long>(arg, t);
  447. } else {
  448. convert_arg<long>(arg, t);
  449. }
  450. break;
  451. case 'j':
  452. convert_arg<intmax_t>(arg, t);
  453. break;
  454. case 'z':
  455. convert_arg<std::size_t>(arg, t);
  456. break;
  457. case 't':
  458. convert_arg<std::ptrdiff_t>(arg, t);
  459. break;
  460. case 'L':
  461. // printf produces garbage when 'L' is omitted for long double, no
  462. // need to do the same.
  463. break;
  464. default:
  465. --it;
  466. convert_arg<void>(arg, c);
  467. }
  468. // Parse type.
  469. if (it == end) FMT_THROW(format_error("invalid format string"));
  470. specs.type = static_cast<char>(*it++);
  471. if (arg.is_integral()) {
  472. // Normalize type.
  473. switch (specs.type) {
  474. case 'i':
  475. case 'u':
  476. specs.type = 'd';
  477. break;
  478. case 'c':
  479. visit_format_arg(internal::char_converter<basic_printf_context>(arg),
  480. arg);
  481. break;
  482. }
  483. }
  484. start = it;
  485. // Format argument.
  486. visit_format_arg(ArgFormatter(out, specs, *this), arg);
  487. }
  488. return std::copy(start, it, out);
  489. }
  490. template <typename Char>
  491. using basic_printf_context_t =
  492. basic_printf_context<std::back_insert_iterator<internal::buffer<Char>>,
  493. Char>;
  494. using printf_context = basic_printf_context_t<char>;
  495. using wprintf_context = basic_printf_context_t<wchar_t>;
  496. using printf_args = basic_format_args<printf_context>;
  497. using wprintf_args = basic_format_args<wprintf_context>;
  498. /**
  499. \rst
  500. Constructs an `~fmt::format_arg_store` object that contains references to
  501. arguments and can be implicitly converted to `~fmt::printf_args`.
  502. \endrst
  503. */
  504. template <typename... Args>
  505. inline format_arg_store<printf_context, Args...> make_printf_args(
  506. const Args&... args) {
  507. return {args...};
  508. }
  509. /**
  510. \rst
  511. Constructs an `~fmt::format_arg_store` object that contains references to
  512. arguments and can be implicitly converted to `~fmt::wprintf_args`.
  513. \endrst
  514. */
  515. template <typename... Args>
  516. inline format_arg_store<wprintf_context, Args...> make_wprintf_args(
  517. const Args&... args) {
  518. return {args...};
  519. }
  520. template <typename S, typename Char = char_t<S>>
  521. inline std::basic_string<Char> vsprintf(
  522. const S& format, basic_format_args<basic_printf_context_t<Char>> args) {
  523. basic_memory_buffer<Char> buffer;
  524. printf(buffer, to_string_view(format), args);
  525. return to_string(buffer);
  526. }
  527. /**
  528. \rst
  529. Formats arguments and returns the result as a string.
  530. **Example**::
  531. std::string message = fmt::sprintf("The answer is %d", 42);
  532. \endrst
  533. */
  534. template <typename S, typename... Args,
  535. typename Char = enable_if_t<internal::is_string<S>::value, char_t<S>>>
  536. inline std::basic_string<Char> sprintf(const S& format, const Args&... args) {
  537. using context = basic_printf_context_t<Char>;
  538. return vsprintf(to_string_view(format), {make_format_args<context>(args...)});
  539. }
  540. template <typename S, typename Char = char_t<S>>
  541. inline int vfprintf(std::FILE* f, const S& format,
  542. basic_format_args<basic_printf_context_t<Char>> args) {
  543. basic_memory_buffer<Char> buffer;
  544. printf(buffer, to_string_view(format), args);
  545. std::size_t size = buffer.size();
  546. return std::fwrite(buffer.data(), sizeof(Char), size, f) < size
  547. ? -1
  548. : static_cast<int>(size);
  549. }
  550. /**
  551. \rst
  552. Prints formatted data to the file *f*.
  553. **Example**::
  554. fmt::fprintf(stderr, "Don't %s!", "panic");
  555. \endrst
  556. */
  557. template <typename S, typename... Args,
  558. typename Char = enable_if_t<internal::is_string<S>::value, char_t<S>>>
  559. inline int fprintf(std::FILE* f, const S& format, const Args&... args) {
  560. using context = basic_printf_context_t<Char>;
  561. return vfprintf(f, to_string_view(format),
  562. {make_format_args<context>(args...)});
  563. }
  564. template <typename S, typename Char = char_t<S>>
  565. inline int vprintf(const S& format,
  566. basic_format_args<basic_printf_context_t<Char>> args) {
  567. return vfprintf(stdout, to_string_view(format), args);
  568. }
  569. /**
  570. \rst
  571. Prints formatted data to ``stdout``.
  572. **Example**::
  573. fmt::printf("Elapsed time: %.2f seconds", 1.23);
  574. \endrst
  575. */
  576. template <typename S, typename... Args,
  577. FMT_ENABLE_IF(internal::is_string<S>::value)>
  578. inline int printf(const S& format_str, const Args&... args) {
  579. using context = basic_printf_context_t<char_t<S>>;
  580. return vprintf(to_string_view(format_str),
  581. {make_format_args<context>(args...)});
  582. }
  583. template <typename S, typename Char = char_t<S>>
  584. inline int vfprintf(std::basic_ostream<Char>& os, const S& format,
  585. basic_format_args<basic_printf_context_t<Char>> args) {
  586. basic_memory_buffer<Char> buffer;
  587. printf(buffer, to_string_view(format), args);
  588. internal::write(os, buffer);
  589. return static_cast<int>(buffer.size());
  590. }
  591. /** Formats arguments and writes the output to the range. */
  592. template <typename ArgFormatter, typename Char,
  593. typename Context =
  594. basic_printf_context<typename ArgFormatter::iterator, Char>>
  595. typename ArgFormatter::iterator vprintf(internal::buffer<Char>& out,
  596. basic_string_view<Char> format_str,
  597. basic_format_args<Context> args) {
  598. typename ArgFormatter::iterator iter(out);
  599. Context(iter, format_str, args).template format<ArgFormatter>();
  600. return iter;
  601. }
  602. /**
  603. \rst
  604. Prints formatted data to the stream *os*.
  605. **Example**::
  606. fmt::fprintf(cerr, "Don't %s!", "panic");
  607. \endrst
  608. */
  609. template <typename S, typename... Args, typename Char = char_t<S>>
  610. inline int fprintf(std::basic_ostream<Char>& os, const S& format_str,
  611. const Args&... args) {
  612. using context = basic_printf_context_t<Char>;
  613. return vfprintf(os, to_string_view(format_str),
  614. {make_format_args<context>(args...)});
  615. }
  616. FMT_END_NAMESPACE
  617. #endif // FMT_PRINTF_H_