Skip to content

Commit 6856071

Browse files
committed
Swap [diff.cpp20.strings] and [diff.cpp20.containers] for numerical clause order
1 parent b1a8692 commit 6856071

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

‎source/compatibility.tex‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -819,30 +819,6 @@
819819
Valid \CppXX{} code that instantiated the removed specialization
820820
can become ill-formed.
821821

822-
\rSec2[diff.cpp20.strings]{\ref*{strings}: strings library}
823-
824-
\diffref{string.classes}
825-
\change
826-
Additional rvalue overload for the \tcode{substr} member function and
827-
the corresponding constructor.
828-
\rationale
829-
Improve efficiency of operations on rvalues.
830-
\effect
831-
Valid \CppXX{} code that created a substring
832-
by calling \tcode{substr} (or the corresponding constructor)
833-
on an xvalue expression with type \tcode{S}
834-
that is a specialization of \tcode{basic_string}
835-
may change meaning in this revision of \Cpp{}.
836-
\begin{example}
837-
\begin{codeblock}
838-
std::string s1 = "some long string that forces allocation", s2 = s1;
839-
std::move(s1).substr(10, 5);
840-
assert(s1 == s2); // unspecified, previously guaranteed to be \tcode{true}
841-
std::string s3(std::move(s2), 10, 5);
842-
assert(s1 == s2); // unspecified, previously guaranteed to be \tcode{true}
843-
\end{codeblock}
844-
\end{example}
845-
846822
\rSec2[diff.cpp20.containers]{\ref*{containers}: containers library}
847823

848824
\diffref{associative.reqmts,unord.req}
@@ -867,6 +843,30 @@
867843
\end{codeblock}
868844
\end{example}
869845

846+
\rSec2[diff.cpp20.strings]{\ref*{strings}: strings library}
847+
848+
\diffref{string.classes}
849+
\change
850+
Additional rvalue overload for the \tcode{substr} member function and
851+
the corresponding constructor.
852+
\rationale
853+
Improve efficiency of operations on rvalues.
854+
\effect
855+
Valid \CppXX{} code that created a substring
856+
by calling \tcode{substr} (or the corresponding constructor)
857+
on an xvalue expression with type \tcode{S}
858+
that is a specialization of \tcode{basic_string}
859+
may change meaning in this revision of \Cpp{}.
860+
\begin{example}
861+
\begin{codeblock}
862+
std::string s1 = "some long string that forces allocation", s2 = s1;
863+
std::move(s1).substr(10, 5);
864+
assert(s1 == s2); // unspecified, previously guaranteed to be \tcode{true}
865+
std::string s3(std::move(s2), 10, 5);
866+
assert(s1 == s2); // unspecified, previously guaranteed to be \tcode{true}
867+
\end{codeblock}
868+
\end{example}
869+
870870
\rSec2[diff.cpp20.thread]{\ref*{thread}: concurrency support library}
871871

872872
\diffref{thread.barrier}

0 commit comments

Comments
 (0)