Skip to content

Commit b1ccb51

Browse files
committed
P3391R2 constexpr std::format
Fixes NB FR-028-271, US 167-270 (C++26 CD).
1 parent 98ce5ac commit b1ccb51

File tree

3 files changed

+101
-76
lines changed

3 files changed

+101
-76
lines changed

source/strings.tex

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,12 +1927,12 @@
19271927
float stof(const string& str, size_t* idx = nullptr);
19281928
double stod(const string& str, size_t* idx = nullptr);
19291929
long double stold(const string& str, size_t* idx = nullptr);
1930-
string to_string(int val);
1931-
string to_string(unsigned val);
1932-
string to_string(long val);
1933-
string to_string(unsigned long val);
1934-
string to_string(long long val);
1935-
string to_string(unsigned long long val);
1930+
constexpr string to_string(int val);
1931+
constexpr string to_string(unsigned val);
1932+
constexpr string to_string(long val);
1933+
constexpr string to_string(unsigned long val);
1934+
constexpr string to_string(long long val);
1935+
constexpr string to_string(unsigned long long val);
19361936
string to_string(float val);
19371937
string to_string(double val);
19381938
string to_string(long double val);
@@ -1945,12 +1945,12 @@
19451945
float stof(const wstring& str, size_t* idx = nullptr);
19461946
double stod(const wstring& str, size_t* idx = nullptr);
19471947
long double stold(const wstring& str, size_t* idx = nullptr);
1948-
wstring to_wstring(int val);
1949-
wstring to_wstring(unsigned val);
1950-
wstring to_wstring(long val);
1951-
wstring to_wstring(unsigned long val);
1952-
wstring to_wstring(long long val);
1953-
wstring to_wstring(unsigned long long val);
1948+
constexpr wstring to_wstring(int val);
1949+
constexpr wstring to_wstring(unsigned val);
1950+
constexpr wstring to_wstring(long val);
1951+
constexpr wstring to_wstring(unsigned long val);
1952+
constexpr wstring to_wstring(long long val);
1953+
constexpr wstring to_wstring(unsigned long long val);
19541954
wstring to_wstring(float val);
19551955
wstring to_wstring(double val);
19561956
wstring to_wstring(long double val);
@@ -5273,12 +5273,12 @@
52735273

52745274
\indexlibraryglobal{to_string}%
52755275
\begin{itemdecl}
5276-
string to_string(int val);
5277-
string to_string(unsigned val);
5278-
string to_string(long val);
5279-
string to_string(unsigned long val);
5280-
string to_string(long long val);
5281-
string to_string(unsigned long long val);
5276+
constexpr string to_string(int val);
5277+
constexpr string to_string(unsigned val);
5278+
constexpr string to_string(long val);
5279+
constexpr string to_string(unsigned long val);
5280+
constexpr string to_string(long long val);
5281+
constexpr string to_string(unsigned long long val);
52825282
string to_string(float val);
52835283
string to_string(double val);
52845284
string to_string(long double val);
@@ -5360,12 +5360,12 @@
53605360

53615361
\indexlibraryglobal{to_wstring}%
53625362
\begin{itemdecl}
5363-
wstring to_wstring(int val);
5364-
wstring to_wstring(unsigned val);
5365-
wstring to_wstring(long val);
5366-
wstring to_wstring(unsigned long val);
5367-
wstring to_wstring(long long val);
5368-
wstring to_wstring(unsigned long long val);
5363+
constexpr wstring to_wstring(int val);
5364+
constexpr wstring to_wstring(unsigned val);
5365+
constexpr wstring to_wstring(long val);
5366+
constexpr wstring to_wstring(unsigned long val);
5367+
constexpr wstring to_wstring(long long val);
5368+
constexpr wstring to_wstring(unsigned long long val);
53695369
wstring to_wstring(float val);
53705370
wstring to_wstring(double val);
53715371
wstring to_wstring(long double val);

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@
631631
// also in \libheader{exception}, \libheader{stdexcept}, \libheader{expected}, \libheader{optional}, \libheader{variant}, and \libheader{format}
632632
#define @\defnlibxname{cpp_lib_constexpr_flat_map}@ 202502L // also in \libheader{flat_map}
633633
#define @\defnlibxname{cpp_lib_constexpr_flat_set}@ 202502L // also in \libheader{flat_set}
634+
#define @\defnlibxname{cpp_lib_constexpr_format}@ 202511L // also in \libheader{format}
634635
#define @\defnlibxname{cpp_lib_constexpr_forward_list}@ 202502L // also in \libheader{forward_list}
635636
#define @\defnlibxname{cpp_lib_constexpr_functional}@ 201907L // freestanding, also in \libheader{functional}
636637
#define @\defnlibxname{cpp_lib_constexpr_inplace_vector}@ 202502L // also in \libheader{inplace_vector}

0 commit comments

Comments
 (0)