Skip to content

Commit aaa2b06

Browse files
authored
Merge 2021-10 LWG Motion 4
P2418R2 Add support for std::generator-like types to std::format
2 parents 26b371e + b094cb6 commit aaa2b06

File tree

2 files changed

+122
-62
lines changed

2 files changed

+122
-62
lines changed

source/compatibility.tex

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,26 @@
7676
// previously threw \tcode{format_error}
7777
\end{codeblock}
7878

79+
\diffref{format}
80+
\change
81+
Signature changes: \tcode{format}, \tcode{format_to}, \tcode{format_to_n},
82+
\tcode{formatted_size}.
83+
\rationale
84+
Enable formatting of views
85+
that do not support iteration when const-qualified and
86+
are not copyable.
87+
\effect
88+
Valid \CppXX{} code that passes bit fields to formatting functions
89+
may become ill-formed. For example:
90+
\begin{codeblock}
91+
struct tiny {
92+
int bit: 1;
93+
};
94+
95+
auto t = tiny();
96+
std::format("{}", t.bit); // ill-formed, previously returned \tcode{"0"}
97+
\end{codeblock}
98+
7999
\rSec1[diff.cpp17]{\Cpp{} and ISO \CppXVII{}}
80100

81101
\rSec2[diff.cpp17.general]{General}

0 commit comments

Comments
 (0)