The <format> header patch series

A short write-up with some additional information of the current <format> patch series in review. This explains the goals and non-goals of the series. The first part describes the current series, the second part the future plans.

Current patch series

This patch series1 implements the first part of the <format> header. The features implemented are:

The implementation hasn’t been optimized for speed nor for code size. This means the code isn’t intended to be ABI stable. Some of these optimizations are required to be Standard compliant. The committee will probably approve another ABI breaking change for C++20; P2216. This means the code isn’t available on the Apple platform since it requires ABI stability2.

The following parts haven’t been implemented yet:

Note: At the moment clang-format doesn’t work well with concepts. Therefore not all code has been formatted properly. Most code still sticks to an 80-column limit. This can be fixed after the series has landed. Fixing that now has only a small benefit, but will probably result in merge conflicts.

Note: The patch series doesn’t implement the correct module mapping. At the moment there’s no CI pipeline to test the modular build. D103559 implements this pipeline. After it lands the series will be rebased and the module mapping will be implemented.

The hope is to get these changes shipped in libc++13.

Future plans

Assuming P2216 will be approved and backported to C++20 during the June 2021 meeting the next steps will be:

After these changes the libc++ ABI should be stable. These features are planned for libc++14. It would be great to get them in libc++13, but that’s unlikely to happen.

The next steps are:

At this point the formatting (except <chrono>) is complete. However there might be new papers and LWG-issues to implement. For example, P1636, P2093, and P2286 might have landed in the C++23 draft.

The hope is to get this done before libc++14.

At this point focus will move to <chrono>, however the author hasn’t checked the current C++20 implementation status of <chrono>.

  1. The series starts with D103357. Phabricator’s revision stack shows the other patches in the series. 

  2. The current apple-clang version, apple-clang 12, has no concepts support which is required to use the <format> header.