mirror of
https://github.com/fmtlib/fmt.git
synced 2025-12-07 01:06:53 +08:00
Merge branch 'fmtlib:master' into master
This commit is contained in:
commit
4a4876dd62
@ -768,9 +768,9 @@ fmt::print("{:n:f}", std::array{std::numbers::pi, std::numbers::e});
|
|||||||
## Format Examples
|
## Format Examples
|
||||||
|
|
||||||
This section contains examples of the format syntax and comparison with
|
This section contains examples of the format syntax and comparison with
|
||||||
the printf formatting.
|
the `printf` formatting.
|
||||||
|
|
||||||
In most of the cases the syntax is similar to the printf formatting,
|
In most of the cases the syntax is similar to the `printf` formatting,
|
||||||
with the addition of the `{}` and with `:` used instead of `%`. For
|
with the addition of the `{}` and with `:` used instead of `%`. For
|
||||||
example, `"%03.2f"` can be translated to `"{:03.2f}"`.
|
example, `"%03.2f"` can be translated to `"{:03.2f}"`.
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,12 @@
|
|||||||
|
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
|
// libc++ supports string_view in pre-c++17.
|
||||||
|
#if FMT_HAS_INCLUDE(<string_view>) && \
|
||||||
|
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
|
||||||
|
# define FMT_USE_STRING_VIEW
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FMT_MODULE
|
#ifndef FMT_MODULE
|
||||||
# include <stdlib.h> // malloc, free
|
# include <stdlib.h> // malloc, free
|
||||||
|
|
||||||
@ -62,11 +68,8 @@
|
|||||||
# include <bit> // std::bit_cast
|
# include <bit> // std::bit_cast
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// libc++ supports string_view in pre-c++17.
|
# if defined(FMT_USE_STRING_VIEW)
|
||||||
# if FMT_HAS_INCLUDE(<string_view>) && \
|
|
||||||
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
|
|
||||||
# include <string_view>
|
# include <string_view>
|
||||||
# define FMT_USE_STRING_VIEW
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if FMT_MSC_VERSION
|
# if FMT_MSC_VERSION
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user