Skip to content

Commit 2c1ab97

Browse files
committed
[string.erasure] Following the guidance given by P0980R1, and after
consultation with LWG chair, mark the std::erase and std::erase_if overloads for std::basic_string as constexpr in addition to those explicitly called out by the wording paper.
1 parent 8644a2c commit 2c1ab97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/strings.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@
639639

640640
// \ref{string.erasure}, erasure
641641
template<class charT, class traits, class Allocator, class U>
642-
void erase(basic_string<charT, traits, Allocator>& c, const U& value);
642+
constexpr void erase(basic_string<charT, traits, Allocator>& c, const U& value);
643643
template<class charT, class traits, class Allocator, class Predicate>
644-
void erase_if(basic_string<charT, traits, Allocator>& c, Predicate pred);
644+
constexpr void erase_if(basic_string<charT, traits, Allocator>& c, Predicate pred);
645645

646646
// \tcode{basic_string} typedef names
647647
using string = basic_string<char>;
@@ -3517,7 +3517,7 @@
35173517
\indexlibrary{\idxcode{erase}!\idxcode{basic_string}}%
35183518
\begin{itemdecl}
35193519
template<class charT, class traits, class Allocator, class U>
3520-
void erase(basic_string<charT, traits, Allocator>& c, const U& value);
3520+
constexpr void erase(basic_string<charT, traits, Allocator>& c, const U& value);
35213521
\end{itemdecl}
35223522

35233523
\begin{itemdescr}
@@ -3529,7 +3529,7 @@
35293529
\indexlibrary{\idxcode{erase_if}!\idxcode{basic_string}}%
35303530
\begin{itemdecl}
35313531
template<class charT, class traits, class Allocator, class Predicate>
3532-
void erase_if(basic_string<charT, traits, Allocator>& c, Predicate pred);
3532+
constexpr void erase_if(basic_string<charT, traits, Allocator>& c, Predicate pred);
35333533
\end{itemdecl}
35343534

35353535
\begin{itemdescr}

0 commit comments

Comments
 (0)