File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 19451945\end {codeblock }
19461946\end {example }
19471947
1948- \rSec 2[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\rSec 2[diff.cpp14.containers]{\ref* {containers }: containers library}
19731949
19741950\diffref {associative.reqmts }
19991975\end {codeblock }
20001976\end {example }
20011977
1978+ \rSec 2[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\rSec 2[diff.cpp14.depr]{\ref* {depr }: compatibility features}
20032003
20042004\nodiffref
You can’t perform that action at this time.
0 commit comments