|
819 | 819 | Valid \CppXX{} code that instantiated the removed specialization |
820 | 820 | can become ill-formed. |
821 | 821 |
|
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 | | - |
846 | 822 | \rSec2[diff.cpp20.containers]{\ref*{containers}: containers library} |
847 | 823 |
|
848 | 824 | \diffref{associative.reqmts,unord.req} |
|
867 | 843 | \end{codeblock} |
868 | 844 | \end{example} |
869 | 845 |
|
| 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 | + |
870 | 870 | \rSec2[diff.cpp20.thread]{\ref*{thread}: concurrency support library} |
871 | 871 |
|
872 | 872 | \diffref{thread.barrier} |
|
0 commit comments