Skip to content

Commit 4126c12

Browse files
jensmaurertkoeppe
authored andcommitted
P2216R3 std::format improvements
- Avoid redundantly presenting the definition of basic-format-string in the header synopsis. - Add dedicated section format.fmt.string for basic-format-string, instead of including it in fmt.error.report. - Reconcile with the earlier adoption of LWG-3539.
1 parent 040df8b commit 4126c12

File tree

3 files changed

+141
-63
lines changed

3 files changed

+141
-63
lines changed

source/compatibility.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@
4040
\end{codeblock}
4141
\end{example}
4242

43+
\rSec2[diff.cpp20.utilities]{\ref{utilities}: general utilities library}
44+
45+
\diffref{format}
46+
\change
47+
Signature changes: \tcode{format}, \tcode{format_to}, \tcode{vformat_to},
48+
\tcode{format_to_n}, \tcode{formatted_size}.
49+
Removal of \tcode{format_args_t}.
50+
\rationale
51+
Improve safety via compile-time format string checks,
52+
avoid unnecessary template instantiations.
53+
\effect
54+
Valid \CppXX{} code that
55+
contained errors in format strings or
56+
relied on previous format string signatures or
57+
\tcode{format_args_t} may become ill-formed.
58+
For example:
59+
\begin{codeblock}
60+
auto s = std::format("{:d}", "I am not a number"); // ill-formed,
61+
// previously threw \tcode{format_error}
62+
\end{codeblock}
63+
4364
\rSec1[diff.cpp17]{\Cpp{} and ISO \CppXVII{}}
4465

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

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@
609609
#define @\defnlibxname{cpp_lib_exchange_function}@ 201304L // also in \libheader{utility}
610610
#define @\defnlibxname{cpp_lib_execution}@ 201902L // also in \libheader{execution}
611611
#define @\defnlibxname{cpp_lib_filesystem}@ 201703L // also in \libheader{filesystem}
612-
#define @\defnlibxname{cpp_lib_format}@ 201907L // also in \libheader{format}
612+
#define @\defnlibxname{cpp_lib_format}@ 202106L // also in \libheader{format}
613613
#define @\defnlibxname{cpp_lib_gcd_lcm}@ 201606L // also in \libheader{numeric}
614614
#define @\defnlibxname{cpp_lib_generic_associative_lookup}@ 201304L // also in \libheader{map}, \libheader{set}
615615
#define @\defnlibxname{cpp_lib_generic_unordered_lookup}@ 201811L

0 commit comments

Comments
 (0)