Skip to content

Commit

Permalink
Merge branch 'fmtlib:master' into zig-pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane authored Jan 5, 2024
2 parents 0f08241 + e0b604b commit 53cb64f
Show file tree
Hide file tree
Showing 17 changed files with 362 additions and 322 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ if (FMT_MODULE)
endif ()
if (FMT_OS)
target_sources(fmt PRIVATE src/os.cc)
else()
target_compile_definitions(fmt PRIVATE FMT_OS=0)
endif ()

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ converts to `std::print`.)
- [Quill](https://github.com/odygrd/quill): asynchronous low-latency
logging library
- [QKW](https://github.com/ravijanjam/qkw): generalizing aliasing to
simplify navigation, and executing complex multi-line terminal
simplify navigation, and execute complex multi-line terminal
command sequences
- [redis-cerberus](https://github.com/HunanTV/redis-cerberus): a Redis
cluster proxy
Expand Down Expand Up @@ -432,7 +432,7 @@ code bloat issues (see [Benchmarks](#benchmarks)).
## FastFormat
This is an interesting library that is fast, safe, and has positional
This is an interesting library that is fast, safe and has positional
arguments. However, it has significant limitations, citing its author:
> Three features that have no hope of being accommodated within the
Expand All @@ -442,8 +442,8 @@ arguments. However, it has significant limitations, citing its author:
> - Octal/hexadecimal encoding
> - Runtime width/alignment specification
It is also quite big and has a heavy dependency, STLSoft, which might be
too restrictive for using it in some projects.
It is also quite big and has a heavy dependency, on STLSoft, which might be
too restrictive for use in some projects.
## Boost Spirit.Karma
Expand Down Expand Up @@ -486,5 +486,5 @@ To report a security issue, please disclose it at [security
advisory](https://github.com/fmtlib/fmt/security/advisories/new).
This project is maintained by a team of volunteers on a
reasonable-effort basis. As such, please give us at least 90 days to
reasonable-effort basis. As such, please give us at least *90* days to
work on a fix before public exposure.
6 changes: 3 additions & 3 deletions doc/_static/bootstrap.min.js

Large diffs are not rendered by default.

13 changes: 4 additions & 9 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,6 @@ Utilities

.. doxygenfunction:: fmt::to_string(const T &value) -> std::string

.. doxygenfunction:: fmt::join(Range &&range, string_view sep) -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>>

.. doxygenfunction:: fmt::join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel>

.. doxygenfunction:: fmt::group_digits(T value) -> group_digits_view<T>

.. doxygenclass:: fmt::detail::buffer
Expand Down Expand Up @@ -469,10 +465,6 @@ The library also supports convenient formatting of ranges and tuples::
// Prints "('a', 1, 2.0)"
fmt::print("{}", t);


NOTE: currently, the overload of ``fmt::join`` for iterables exists in the main
``format.h`` header, but expect this to change in the future.

Using ``fmt::join``, you can separate tuple elements with a custom separator::

#include <fmt/ranges.h>
Expand All @@ -481,6 +473,9 @@ Using ``fmt::join``, you can separate tuple elements with a custom separator::
// Prints "1, a"
fmt::print("{}", fmt::join(t, ", "));

.. doxygenfunction:: fmt::join(Range &&range, string_view sep) -> join_view<detail::iterator_t<Range>, detail::sentinel_t<Range>>
.. doxygenfunction:: fmt::join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel>

.. _chrono-api:

Date and Time Formatting
Expand Down Expand Up @@ -516,7 +511,7 @@ The format syntax is described in :ref:`chrono-specs`.

.. doxygenfunction:: localtime(std::time_t time)

.. doxygenfunction:: gmtime(std::time_t time)
.. doxygenfunction:: gmtime(std::time_t time) -> std::tm

.. _std-api:

Expand Down
2 changes: 1 addition & 1 deletion doc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def build_docs(version='dev', **kwargs):
CASE_SENSE_NAMES = NO
INPUT = {0}/args.h {0}/chrono.h {0}/color.h {0}/core.h \
{0}/compile.h {0}/format.h {0}/os.h {0}/ostream.h \
{0}/printf.h {0}/xchar.h
{0}/printf.h {0}/ranges.h {0}/xchar.h
QUIET = YES
JAVADOC_AUTOBRIEF = YES
AUTOLINK_SUPPORT = NO
Expand Down
3 changes: 2 additions & 1 deletion doc/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ Preceding the *width* field by a zero (``'0'``) character enables sign-aware
zero-padding for numeric types. It forces the padding to be placed after the
sign or base (if any) but before the digits. This is used for printing fields in
the form '+000000120'. This option is only valid for numeric types and it has no
effect on formatting of infinity and NaN.
effect on formatting of infinity and NaN. This option is ignored when any
alignment specifier is present.

The *precision* is a decimal number indicating how many digits should be
displayed after the decimal point for a floating-point value formatted with
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <memory> // std::unique_ptr
#include <vector>

#include "core.h"
#include "format.h" // std_string_view

FMT_BEGIN_NAMESPACE

Expand Down
2 changes: 1 addition & 1 deletion include/fmt/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ template <typename Char> struct ansi_color_escape {
FMT_CONSTEXPR operator const Char*() const noexcept { return buffer; }

FMT_CONSTEXPR auto begin() const noexcept -> const Char* { return buffer; }
FMT_CONSTEXPR_CHAR_TRAITS auto end() const noexcept -> const Char* {
FMT_CONSTEXPR20 auto end() const noexcept -> const Char* {
return buffer + std::char_traits<Char>::length(buffer);
}

Expand Down
Loading

0 comments on commit 53cb64f

Please sign in to comment.