Skip to content

Commit b19f63e

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

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
@@ -1945,30 +1945,6 @@
19451945
\end{codeblock}
19461946
\end{example}
19471947

1948-
\rSec2[diff.cpp14.string]{\ref*{strings}: strings library}
1949-
1950-
\diffref{basic.string}
1951-
\change
1952-
Non-const \tcode{.data()} member added.
1953-
\rationale
1954-
The lack of a non-const \tcode{.data()}
1955-
differed from the similar member of \tcode{std::vector}.
1956-
This change regularizes behavior.
1957-
\effect
1958-
Overloaded functions which have differing code paths
1959-
for \tcode{char*} and \tcode{const char*} arguments
1960-
will execute differently
1961-
when called with a non-const string's \tcode{.data()} member
1962-
in this revision of \Cpp{}.
1963-
\begin{example}
1964-
\begin{codeblock}
1965-
int f(char *) = delete;
1966-
int f(const char *);
1967-
string s;
1968-
int x = f(s.data()); // ill-formed; previously well-formed
1969-
\end{codeblock}
1970-
\end{example}
1971-
19721948
\rSec2[diff.cpp14.containers]{\ref*{containers}: containers library}
19731949

19741950
\diffref{associative.reqmts}
@@ -1999,6 +1975,30 @@
19991975
\end{codeblock}
20001976
\end{example}
20011977

1978+
\rSec2[diff.cpp14.string]{\ref*{strings}: strings library}
1979+
1980+
\diffref{basic.string}
1981+
\change
1982+
Non-const \tcode{.data()} member added.
1983+
\rationale
1984+
The lack of a non-const \tcode{.data()}
1985+
differed from the similar member of \tcode{std::vector}.
1986+
This change regularizes behavior.
1987+
\effect
1988+
Overloaded functions which have differing code paths
1989+
for \tcode{char*} and \tcode{const char*} arguments
1990+
will execute differently
1991+
when called with a non-const string's \tcode{.data()} member
1992+
in this revision of \Cpp{}.
1993+
\begin{example}
1994+
\begin{codeblock}
1995+
int f(char *) = delete;
1996+
int f(const char *);
1997+
string s;
1998+
int x = f(s.data()); // ill-formed; previously well-formed
1999+
\end{codeblock}
2000+
\end{example}
2001+
20022002
\rSec2[diff.cpp14.depr]{\ref*{depr}: compatibility features}
20032003

20042004
\nodiffref

0 commit comments

Comments
 (0)