diff --git a/source/iostreams.tex b/source/iostreams.tex index dc23d3c5f2..c264412488 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -7746,14 +7746,14 @@ If the ordinary literal encoding\iref{lex.charset} is UTF-8, equivalent to: \begin{codeblock} locksafe - ? vprint_unicode_locking(stream, fmt.str, make_format_args(args...)) - : vprint_unicode(stream, fmt.str, make_format_args(args...)); + ? vprint_unicode(stream, fmt.str, make_format_args(args...)) + : vprint_unicode_buffered(stream, fmt.str, make_format_args(args...)); \end{codeblock} Otherwise, equivalent to: \begin{codeblock} locksafe - ? vprint_nonunicode_locking(stream, fmt.str, make_format_args(args...)) - : vprint_nonunicode(stream, fmt.str, make_format_args(args...)); + ? vprint_nonunicode(stream, fmt.str, make_format_args(args...)) + : vprint_nonunicode_buffered(stream, fmt.str, make_format_args(args...)); \end{codeblock} \end{itemdescr} @@ -7829,9 +7829,9 @@ \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_unicode}% +\indexlibraryglobal{vprint_unicode_buffered}% \begin{itemdecl} -void vprint_unicode(FILE* stream, string_view fmt, format_args args); +void vprint_unicode_buffered(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} @@ -7840,13 +7840,13 @@ Equivalent to: \begin{codeblock} string out = vformat(fmt, args); -vprint_unicode_locking(stream, "{}", make_format_args(out)); +vprint_unicode(stream, "{}", make_format_args(out)); \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_unicode_locking}% +\indexlibraryglobal{vprint_unicode}% \begin{itemdecl} -void vprint_unicode_locking(FILE* stream, string_view fmt, format_args args); +void vprint_unicode(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} @@ -7912,9 +7912,9 @@ \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_nonunicode}% +\indexlibraryglobal{vprint_nonunicode_buffered}% \begin{itemdecl} -void vprint_nonunicode(FILE* stream, string_view fmt, format_args args); +void vprint_nonunicode_buffered(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} @@ -7923,13 +7923,13 @@ Equivalent to: \begin{codeblock} string out = vformat(fmt, args); -vprint_nonunicode_locking("{}", make_format_args(out)); +vprint_nonunicode("{}", make_format_args(out)); \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_nonunicode_locking}% +\indexlibraryglobal{vprint_nonunicode}% \begin{itemdecl} -void vprint_nonunicode_locking(FILE* stream, string_view fmt, format_args args); +void vprint_nonunicode(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} diff --git a/source/support.tex b/source/support.tex index fa2ac7a15b..3c5939f914 100644 --- a/source/support.tex +++ b/source/support.tex @@ -732,7 +732,7 @@ #define @\defnlibxname{cpp_lib_out_ptr}@ 202311L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric} #define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource} -#define @\defnlibxname{cpp_lib_print}@ 202403L // also in \libheader{print}, \libheader{ostream} +#define @\defnlibxname{cpp_lib_print}@ 202406L // also in \libheader{print}, \libheader{ostream} #define @\defnlibxname{cpp_lib_quoted_string_io}@ 201304L // also in \libheader{iomanip} #define @\defnlibxname{cpp_lib_ranges}@ 202406L // also in \libheader{algorithm}, \libheader{functional}, \libheader{iterator}, \libheader{memory}, \libheader{ranges} diff --git a/source/time.tex b/source/time.tex index 6d0d2b398f..20908f8850 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10828,6 +10828,27 @@ \end{codeblock} \end{example} +\pnum +For \tcode{chrono::duration} +the library only provides the following specialization +of \tcode{enable_nonlocking_formatter_optimization}: +\begin{codeblock} +template + inline constexpr bool enable_nonlocking_formatter_optimization< + chrono::duration> = + enable_nonlocking_formatter_optimization; +\end{codeblock} + +\pnum +For \tcode{chrono::zoned_time} +the library only provides the following specialization of +\tcode{enable_nonlocking_formatter_optimization}: +\begin{codeblock} +template + inline constexpr bool enable_nonlocking_formatter_optimization< + chrono::zoned_time> = true; +\end{codeblock} + \indexlibrary{\idxcode{formatter}!specializations!\idxcode{chrono::sys_time}}% \begin{itemdecl} template diff --git a/source/utilities.tex b/source/utilities.tex index fcbb038a43..72a714d64a 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15897,6 +15897,10 @@ @\libconcept{formattable}@, charT> struct formatter : @\exposid{range-default-formatter}@, R, charT> { }; + template + requires (format_kind != range_format::disabled) + inline constexpr bool enable_nonlocking_formatter_optimization = false; + // \ref{format.arguments}, arguments // \ref{format.arg}, class template \tcode{basic_format_arg} template class basic_format_arg; @@ -17214,9 +17218,10 @@ interpret the format specification as a \fmtgrammarterm{std-format-spec} as described in \ref{format.string.std}. -In addition, -for each type \tcode{T} for which -a \tcode{formatter} specialization is provided above, + +\pnum +Unless specified otherwise, for each type \tcode{T} for which +a \tcode{formatter} specialization is provided by the library, each of the headers provides the following specialization: \begin{codeblock} template<> inline constexpr bool enable_nonlocking_formatter_optimization = true; @@ -18795,6 +18800,10 @@ typename FormatContext::iterator format(@\seebelow@& elems, FormatContext& ctx) const; }; + + template + inline constexpr bool enable_nonlocking_formatter_optimization<@\placeholder{pair-or-tuple}@> = + (enable_nonlocking_formatter_optimization && ...); } \end{codeblock}