Skip to content

Commit cfaad31

Browse files
Update README.md
1 parent 14325d0 commit cfaad31

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Workarounds/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ You can find these in the `NoModules` directories of this source repository.
2525
<a name="format"/>
2626

2727
## std::format()
28-
As of today, no compiler [supports](https://en.cppreference.com/w/cpp/compiler_support) the C++20 `<format>` module yet.
28+
It's not until recently that some major compilers started adding [support](https://en.cppreference.com/w/cpp/compiler_support) for the C++20 `<format>` module.
2929
This module provides safe, elegant, and efficient text formatting, primeraly in the form of the `std::format()` function,
3030
and is heavily used throughout the C++20 edition of the book.
3131

32-
As a workaround, we recommend the [`{fmt}`](https://fmt.dev/) library,
33-
a free and open source implementation of a superset of the now standardised `<format>` module.
32+
If your compiler is too old to [support](https://en.cppreference.com/w/cpp/compiler_support) `<format>` natively,
33+
we recommend the [`{fmt}`](https://fmt.dev/) library as a workaround.
34+
It is a free and open source implementation of a superset of the now standardised `<format>` module.
3435

3536
Steps:
3637
1. Download the `fmt` source code
@@ -58,9 +59,10 @@ Steps:
5859
and all `std::format()` statements will work as expected.
5960

6061
Note: this workaround works for `#include <format>` directives (see [Appendix A](../Appendix.pdf));
61-
but we have not had much luck getting this to work with C++20's `import` declarations.
62-
Until further notice, we therefore recommend you mostly use the `NoModules` versions of the source code.
63-
If you do want to experiment with modules, and `std::format()` is getting in the way of that,
62+
but at the time of writing we weren't having much luck getting this to work with C++20's `import` declarations.
63+
If you're experiencing similar problems,
64+
we therefore recommend you mostly use the `NoModules` versions of the source code.
65+
If you do want to experiment with modules and `std::format()` is getting in the way of that,
6466
you can, for instance, add the following to your source files
6567

6668
namespace std
@@ -98,10 +100,10 @@ you use
98100

99101
## Ranges
100102

101-
At the time of writing,
102-
not all Standard Library implementations [support](https://en.cppreference.com/w/cpp/compiler_support) C++20 ranges yet
103-
(and if they do, not all range algorithms are working as they should).
104-
As a workaround, you can try the excellent [range-v3](https://github.com/ericniebler/range-v3) library of Eric Niebler.
103+
Similar to `<format>`,
104+
it took some time for all Standard Library implementations to add [support](https://en.cppreference.com/w/cpp/compiler_support) for C++20 ranges
105+
(and if they had support, not all range algorithms were working as they should).
106+
If you experience issues, you can try the excellent [range-v3](https://github.com/ericniebler/range-v3) library of Eric Niebler instead.
105107
We added the [header file](ranges) we used for this to this directory.
106108
The steps you need to get this to work are similar to those we detailed for [`std::format()`](#format),
107109
except that library needs to be compiled as well,

0 commit comments

Comments
 (0)