Skip to content

Commit 954b4ab

Browse files
committed
P2508R1 Expose std::basic-format-string<charT, Args...>
1 parent d59a4f3 commit 954b4ab

File tree

2 files changed

+50
-48
lines changed

2 files changed

+50
-48
lines changed

source/support.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@
617617
#define @\defnlibxname{cpp_lib_execution}@ 201902L // also in \libheader{execution}
618618
#define @\defnlibxname{cpp_lib_expected}@ 202202L // also in \libheader{expected}
619619
#define @\defnlibxname{cpp_lib_filesystem}@ 201703L // also in \libheader{filesystem}
620-
#define @\defnlibxname{cpp_lib_format}@ 202110L // also in \libheader{format}
620+
#define @\defnlibxname{cpp_lib_format}@ 202207L // also in \libheader{format}
621621
#define @\defnlibxname{cpp_lib_gcd_lcm}@ 201606L // also in \libheader{numeric}
622622
#define @\defnlibxname{cpp_lib_generic_associative_lookup}@ 201304L // also in \libheader{map}, \libheader{set}
623623
#define @\defnlibxname{cpp_lib_generic_unordered_lookup}@ 201811L

source/utilities.tex

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13402,40 +13402,38 @@
1340213402
using format_args = basic_format_args<format_context>;
1340313403
using wformat_args = basic_format_args<wformat_context>;
1340413404

13405-
// \ref{format.fmt.string}, class template \exposid{basic-format-string}
13405+
// \ref{format.fmt.string}, class template \tcode{basic_format_string}
1340613406
template<class charT, class... Args>
13407-
struct @\exposid{basic-format-string}@; // \expos
13407+
struct basic_format_string;
1340813408

1340913409
template<class... Args>
13410-
using @\exposid{format-string}@ = // \expos
13411-
@\exposid{basic-format-string}@<char, type_identity_t<Args>...>;
13410+
using @\libglobal{format_string}@ = basic_format_string<char, type_identity_t<Args>...>;
1341213411
template<class... Args>
13413-
using @\exposid{wformat-string}@ = // \expos
13414-
@\exposid{basic-format-string}@<wchar_t, type_identity_t<Args>...>;
13412+
using @\libglobal{wformat_string}@ = basic_format_string<wchar_t, type_identity_t<Args>...>;
1341513413

1341613414
// \ref{format.functions}, formatting functions
1341713415
template<class... Args>
13418-
string format(@\exposid{format-string}@<Args...> fmt, Args&&... args);
13416+
string format(format_string<Args...> fmt, Args&&... args);
1341913417
template<class... Args>
13420-
wstring format(@\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13418+
wstring format(wformat_string<Args...> fmt, Args&&... args);
1342113419
template<class... Args>
13422-
string format(const locale& loc, @\exposid{format-string}@<Args...> fmt, Args&&... args);
13420+
string format(const locale& loc, format_string<Args...> fmt, Args&&... args);
1342313421
template<class... Args>
13424-
wstring format(const locale& loc, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13422+
wstring format(const locale& loc, wformat_string<Args...> fmt, Args&&... args);
1342513423

1342613424
string vformat(string_view fmt, format_args args);
1342713425
wstring vformat(wstring_view fmt, wformat_args args);
1342813426
string vformat(const locale& loc, string_view fmt, format_args args);
1342913427
wstring vformat(const locale& loc, wstring_view fmt, wformat_args args);
1343013428

1343113429
template<class Out, class... Args>
13432-
Out format_to(Out out, @\exposid{format-string}@<Args...> fmt, Args&&... args);
13430+
Out format_to(Out out, format_string<Args...> fmt, Args&&... args);
1343313431
template<class Out, class... Args>
13434-
Out format_to(Out out, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13432+
Out format_to(Out out, wformat_string<Args...> fmt, Args&&... args);
1343513433
template<class Out, class... Args>
13436-
Out format_to(Out out, const locale& loc, @\exposid{format-string}@<Args...> fmt, Args&&... args);
13434+
Out format_to(Out out, const locale& loc, format_string<Args...> fmt, Args&&... args);
1343713435
template<class Out, class... Args>
13438-
Out format_to(Out out, const locale& loc, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13436+
Out format_to(Out out, const locale& loc, wformat_string<Args...> fmt, Args&&... args);
1343913437

1344013438
template<class Out>
1344113439
Out vformat_to(Out out, string_view fmt, format_args args);
@@ -13452,27 +13450,27 @@
1345213450
};
1345313451
template<class Out, class... Args>
1345413452
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
13455-
@\exposid{format-string}@<Args...> fmt, Args&&... args);
13453+
format_string<Args...> fmt, Args&&... args);
1345613454
template<class Out, class... Args>
1345713455
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
13458-
@\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13456+
wformat_string<Args...> fmt, Args&&... args);
1345913457
template<class Out, class... Args>
1346013458
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
13461-
const locale& loc, @\exposid{format-string}@<Args...> fmt,
13459+
const locale& loc, format_string<Args...> fmt,
1346213460
Args&&... args);
1346313461
template<class Out, class... Args>
1346413462
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
13465-
const locale& loc, @\exposid{wformat-string}@<Args...> fmt,
13463+
const locale& loc, wformat_string<Args...> fmt,
1346613464
Args&&... args);
1346713465

1346813466
template<class... Args>
13469-
size_t formatted_size(@\exposid{format-string}@<Args...> fmt, Args&&... args);
13467+
size_t formatted_size(format_string<Args...> fmt, Args&&... args);
1347013468
template<class... Args>
13471-
size_t formatted_size(@\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13469+
size_t formatted_size(wformat_string<Args...> fmt, Args&&... args);
1347213470
template<class... Args>
13473-
size_t formatted_size(const locale& loc, @\exposid{format-string}@<Args...> fmt, Args&&... args);
13471+
size_t formatted_size(const locale& loc, format_string<Args...> fmt, Args&&... args);
1347413472
template<class... Args>
13475-
size_t formatted_size(const locale& loc, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
13473+
size_t formatted_size(const locale& loc, wformat_string<Args...> fmt, Args&&... args);
1347613474

1347713475
// \ref{format.formatter}, formatter
1347813476
template<class T, class charT = char> struct formatter;
@@ -14213,21 +14211,25 @@
1421314211
Failure to allocate storage is reported by
1421414212
throwing an exception as described in~\ref{res.on.exception.handling}.
1421514213

14216-
\rSec2[format.fmt.string]{Class template \exposid{basic-format-string}}
14214+
\rSec2[format.fmt.string]{Class template \tcode{basic_format_string}}
1421714215

1421814216
\begin{codeblock}
14219-
template<class charT, class... Args>
14220-
struct @\exposid{basic-format-string}@ { // \expos
14221-
private:
14222-
basic_string_view<charT> @\exposid{str}@; // \expos
14217+
namespace std {
14218+
template<class charT, class... Args>
14219+
struct @\libglobal{basic_format_string}@ {
14220+
private:
14221+
basic_string_view<charT> @\exposid{str}@; // \expos
1422314222

14224-
public:
14225-
template<class T> consteval @\exposid{basic-format-string}@(const T& s);
14226-
};
14223+
public:
14224+
template<class T> consteval basic_format_string(const T& s);
14225+
14226+
constexpr basic_string_view<charT> get() const noexcept { return @\exposid{str}@; }
14227+
};
14228+
}
1422714229
\end{codeblock}
1422814230

1422914231
\begin{itemdecl}
14230-
template<class T> consteval @\exposid{basic-format-string}@(const T& s);
14232+
template<class T> consteval basic_format_string(const T& s);
1423114233
\end{itemdecl}
1423214234

1423314235
\begin{itemdescr}
@@ -14257,7 +14259,7 @@
1425714259
\indexlibraryglobal{format}%
1425814260
\begin{itemdecl}
1425914261
template<class... Args>
14260-
string format(@\exposid{format-string}@<Args...> fmt, Args&&... args);
14262+
string format(format_string<Args...> fmt, Args&&... args);
1426114263
\end{itemdecl}
1426214264

1426314265
\begin{itemdescr}
@@ -14272,7 +14274,7 @@
1427214274
\indexlibraryglobal{format}%
1427314275
\begin{itemdecl}
1427414276
template<class... Args>
14275-
wstring format(@\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14277+
wstring format(wformat_string<Args...> fmt, Args&&... args);
1427614278
\end{itemdecl}
1427714279

1427814280
\begin{itemdescr}
@@ -14287,7 +14289,7 @@
1428714289
\indexlibraryglobal{format}%
1428814290
\begin{itemdecl}
1428914291
template<class... Args>
14290-
string format(const locale& loc, @\exposid{format-string}@<Args...> fmt, Args&&... args);
14292+
string format(const locale& loc, format_string<Args...> fmt, Args&&... args);
1429114293
\end{itemdecl}
1429214294

1429314295
\begin{itemdescr}
@@ -14302,7 +14304,7 @@
1430214304
\indexlibraryglobal{format}%
1430314305
\begin{itemdecl}
1430414306
template<class... Args>
14305-
wstring format(const locale& loc, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14307+
wstring format(const locale& loc, wformat_string<Args...> fmt, Args&&... args);
1430614308
\end{itemdecl}
1430714309

1430814310
\begin{itemdescr}
@@ -14338,7 +14340,7 @@
1433814340
\indexlibraryglobal{format_to}%
1433914341
\begin{itemdecl}
1434014342
template<class Out, class... Args>
14341-
Out format_to(Out out, @\exposid{format-string}@<Args...> fmt, Args&&... args);
14343+
Out format_to(Out out, format_string<Args...> fmt, Args&&... args);
1434214344
\end{itemdecl}
1434314345

1434414346
\begin{itemdescr}
@@ -14353,7 +14355,7 @@
1435314355
\indexlibraryglobal{format_to}%
1435414356
\begin{itemdecl}
1435514357
template<class Out, class... Args>
14356-
Out format_to(Out out, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14358+
Out format_to(Out out, wformat_string<Args...> fmt, Args&&... args);
1435714359
\end{itemdecl}
1435814360

1435914361
\begin{itemdescr}
@@ -14368,7 +14370,7 @@
1436814370
\indexlibraryglobal{format_to}%
1436914371
\begin{itemdecl}
1437014372
template<class Out, class... Args>
14371-
Out format_to(Out out, const locale& loc, @\exposid{format-string}@<Args...> fmt, Args&&... args);
14373+
Out format_to(Out out, const locale& loc, format_string<Args...> fmt, Args&&... args);
1437214374
\end{itemdecl}
1437314375

1437414376
\begin{itemdescr}
@@ -14383,7 +14385,7 @@
1438314385
\indexlibraryglobal{format_to}%
1438414386
\begin{itemdecl}
1438514387
template<class Out, class... Args>
14386-
Out format_to(Out out, const locale& loc, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14388+
Out format_to(Out out, const locale& loc, wformat_string<Args...> fmt, Args&&... args);
1438714389
\end{itemdecl}
1438814390

1438914391
\begin{itemdescr}
@@ -14441,17 +14443,17 @@
1444114443
\begin{itemdecl}
1444214444
template<class Out, class... Args>
1444314445
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
14444-
@\exposid{format-string}@<Args...> fmt, Args&&... args);
14446+
format_string<Args...> fmt, Args&&... args);
1444514447
template<class Out, class... Args>
1444614448
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
14447-
@\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14449+
wformat_string<Args...> fmt, Args&&... args);
1444814450
template<class Out, class... Args>
1444914451
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
14450-
const locale& loc, @\exposid{format-string}@<Args...> fmt,
14452+
const locale& loc, format_string<Args...> fmt,
1445114453
Args&&... args);
1445214454
template<class Out, class... Args>
1445314455
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
14454-
const locale& loc, @\exposid{wformat-string}@<Args...> fmt,
14456+
const locale& loc, wformat_string<Args...> fmt,
1445514457
Args&&... args);
1445614458
\end{itemdecl}
1445714459

@@ -14497,13 +14499,13 @@
1449714499
\indexlibraryglobal{formatted_size}%
1449814500
\begin{itemdecl}
1449914501
template<class... Args>
14500-
size_t formatted_size(@\exposid{format-string}@<Args...> fmt, Args&&... args);
14502+
size_t formatted_size(format_string<Args...> fmt, Args&&... args);
1450114503
template<class... Args>
14502-
size_t formatted_size(@\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14504+
size_t formatted_size(wformat_string<Args...> fmt, Args&&... args);
1450314505
template<class... Args>
14504-
size_t formatted_size(const locale& loc, @\exposid{format-string}@<Args...> fmt, Args&&... args);
14506+
size_t formatted_size(const locale& loc, format_string<Args...> fmt, Args&&... args);
1450514507
template<class... Args>
14506-
size_t formatted_size(const locale& loc, @\exposid{wformat-string}@<Args...> fmt, Args&&... args);
14508+
size_t formatted_size(const locale& loc, wformat_string<Args...> fmt, Args&&... args);
1450714509
\end{itemdecl}
1450814510

1450914511
\begin{itemdescr}

0 commit comments

Comments
 (0)