Skip to content

Commit b8a05e1

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

File tree

3 files changed

+113
-88
lines changed

3 files changed

+113
-88
lines changed

source/strings.tex

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,15 +1927,15 @@
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);
1936-
string to_string(float val);
1937-
string to_string(double val);
1938-
string to_string(long double 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);
1936+
constexpr string to_string(float val);
1937+
constexpr string to_string(double val);
1938+
constexpr string to_string(long double val);
19391939

19401940
int stoi(const wstring& str, size_t* idx = nullptr, int base = 10);
19411941
long stol(const wstring& str, size_t* idx = nullptr, int base = 10);
@@ -1945,15 +1945,15 @@
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);
1954-
wstring to_wstring(float val);
1955-
wstring to_wstring(double val);
1956-
wstring to_wstring(long double 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);
1954+
constexpr wstring to_wstring(float val);
1955+
constexpr wstring to_wstring(double val);
1956+
constexpr wstring to_wstring(long double val);
19571957

19581958
namespace pmr {
19591959
template<class charT, class traits = char_traits<charT>>
@@ -5273,15 +5273,15 @@
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);
5282-
string to_string(float val);
5283-
string to_string(double val);
5284-
string to_string(long double 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);
5282+
constexpr string to_string(float val);
5283+
constexpr string to_string(double val);
5284+
constexpr string to_string(long double val);
52855285
\end{itemdecl}
52865286

52875287
\begin{itemdescr}
@@ -5360,15 +5360,15 @@
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);
5369-
wstring to_wstring(float val);
5370-
wstring to_wstring(double val);
5371-
wstring to_wstring(long double 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);
5369+
constexpr wstring to_wstring(float val);
5370+
constexpr wstring to_wstring(double val);
5371+
constexpr wstring to_wstring(long double val);
53725372
\end{itemdecl}
53735373

53745374
\begin{itemdescr}

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)