Skip to content

Commit 1c74f6e

Browse files
committed
Update fmt lib in contrib to version 9.1.0
1 parent 9087ce2 commit 1c74f6e

File tree

15 files changed

+5736
-3738
lines changed

15 files changed

+5736
-3738
lines changed

contrib/fmt/README.contrib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Source: https://github.com/fmtlib/fmt
2-
Revision: v8.0.1
2+
Revision: v9.1.0

contrib/fmt/README.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
{fmt}
2-
=====
1+
.. image:: https://user-images.githubusercontent.com/
2+
576385/156254208-f5b743a9-88cf-439d-b0c0-923d53e8d551.png
3+
:width: 25%
4+
:alt: {fmt}
35

46
.. image:: https://github.com/fmtlib/fmt/workflows/linux/badge.svg
57
:target: https://github.com/fmtlib/fmt/actions?query=workflow%3Alinux
@@ -10,9 +12,6 @@
1012
.. image:: https://github.com/fmtlib/fmt/workflows/windows/badge.svg
1113
:target: https://github.com/fmtlib/fmt/actions?query=workflow%3Awindows
1214

13-
.. image:: https://ci.appveyor.com/api/projects/status/ehjkiefde6gucy1v
14-
:target: https://ci.appveyor.com/project/vitaut/fmt
15-
1615
.. image:: https://oss-fuzz-build-logs.storage.googleapis.com/badges/fmt.svg
1716
:alt: fmt is continuously fuzzed at oss-fuzz
1817
:target: https://bugs.chromium.org/p/oss-fuzz/issues/list?\
@@ -26,12 +25,13 @@
2625
**{fmt}** is an open-source formatting library providing a fast and safe
2726
alternative to C stdio and C++ iostreams.
2827

29-
If you like this project, please consider donating to the BYSOL
30-
Foundation that helps victims of political repressions in Belarus:
31-
https://bysol.org/en/bs/general/.
28+
If you like this project, please consider donating to one of the funds that
29+
help victims of the war in Ukraine: https://www.stopputin.net/.
3230

3331
`Documentation <https://fmt.dev>`__
3432

33+
`Cheat Sheets <https://hackingcpp.com/cpp/libs/fmt.html>`__
34+
3535
Q&A: ask questions on `StackOverflow with the tag fmt
3636
<https://stackoverflow.com/questions/tagged/fmt>`_.
3737

@@ -123,7 +123,7 @@ Output::
123123
Default format: 42s 100ms
124124
strftime-like format: 03:15:30
125125

126-
**Print a container** (`run <https://godbolt.org/z/MjsY7c>`_)
126+
**Print a container** (`run <https://godbolt.org/z/MxM1YqjE7>`_)
127127

128128
.. code:: c++
129129

@@ -143,10 +143,10 @@ Output::
143143

144144
.. code:: c++
145145

146-
std::string s = fmt::format(FMT_STRING("{:d}"), "I am not a number");
146+
std::string s = fmt::format("{:d}", "I am not a number");
147147

148-
This gives a compile-time error because ``d`` is an invalid format specifier for
149-
a string.
148+
This gives a compile-time error in C++20 because ``d`` is an invalid format
149+
specifier for a string.
150150

151151
**Write a file from a single thread**
152152

@@ -205,7 +205,7 @@ The above results were generated by building ``tinyformat_test.cpp`` on macOS
205205
best of three runs. In the test, the format string ``"%0.10f:%04d:%+g:%s:%p:%c:%%\n"``
206206
or equivalent is filled 2,000,000 times with output sent to ``/dev/null``; for
207207
further details refer to the `source
208-
<https://github.com/fmtlib/format-benchmark/blob/master/tinyformat_test.cpp>`_.
208+
<https://github.com/fmtlib/format-benchmark/blob/master/src/tinyformat-test.cc>`_.
209209

210210
{fmt} is up to 20-30x faster than ``std::ostringstream`` and ``sprintf`` on
211211
floating-point formatting (`dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_)
@@ -341,9 +341,12 @@ Projects using this library
341341

342342
* `Folly <https://github.com/facebook/folly>`_: Facebook open-source library
343343

344+
* `GemRB <https://gemrb.org/>`_: a portable open-source implementation of
345+
Bioware’s Infinity Engine
346+
344347
* `Grand Mountain Adventure
345348
<https://store.steampowered.com/app/1247360/Grand_Mountain_Adventure/>`_:
346-
A beautiful open-world ski & snowboarding game
349+
a beautiful open-world ski & snowboarding game
347350

348351
* `HarpyWar/pvpgn <https://github.com/pvpgn/pvpgn-server>`_:
349352
Player vs Player Gaming Network with tweaks
@@ -469,7 +472,7 @@ Boost Format
469472

470473
This is a very powerful library which supports both ``printf``-like format
471474
strings and positional arguments. Its main drawback is performance. According to
472-
various, benchmarks it is much slower than other methods considered here. Boost
475+
various benchmarks, it is much slower than other methods considered here. Boost
473476
Format also has excessive build times and severe code bloat issues (see
474477
`Benchmarks`_).
475478

contrib/fmt/include/fmt/args.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ class dynamic_format_arg_store
9595
};
9696

9797
template <typename T>
98-
using stored_type = conditional_t<detail::is_string<T>::value &&
99-
!has_formatter<T, Context>::value &&
100-
!detail::is_reference_wrapper<T>::value,
101-
std::basic_string<char_type>, T>;
98+
using stored_type = conditional_t<
99+
std::is_convertible<T, std::basic_string<char_type>>::value &&
100+
!detail::is_reference_wrapper<T>::value,
101+
std::basic_string<char_type>, T>;
102102

103103
// Storage of basic_format_arg must be contiguous.
104104
std::vector<basic_format_arg<Context>> data_;
@@ -143,6 +143,8 @@ class dynamic_format_arg_store
143143
}
144144

145145
public:
146+
constexpr dynamic_format_arg_store() = default;
147+
146148
/**
147149
\rst
148150
Adds an argument into the dynamic store for later passing to a formatting

0 commit comments

Comments
 (0)