36 lines
1.0 KiB
Markdown
36 lines
1.0 KiB
Markdown
[diff.cpp14.string]
|
||
|
||
# Annex C (informative) Compatibility [[diff]](./#diff)
|
||
|
||
## C.4 C++ and ISO C++ 2014 [[diff.cpp14]](diff.cpp14#string)
|
||
|
||
### C.4.10 [[strings]](strings "27 Strings library"): strings library [diff.cpp14.string]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/compatibility.tex#L1875)
|
||
|
||
**Affected subclause:** [[basic.string]](basic.string)
|
||
|
||
|
||
**Change:** Non-const .data() member added[.](#1.sentence-1)
|
||
|
||
|
||
|
||
|
||
**Rationale:** The lack of a non-const .data() differed from the similar member of std::vector[.](#1.sentence-2)
|
||
|
||
This change regularizes behavior[.](#1.sentence-3)
|
||
|
||
|
||
|
||
|
||
**Effect on original feature:** Overloaded functions which have differing code paths
|
||
for char* and const char* arguments
|
||
will execute differently
|
||
when called with a non-const string's .data() member
|
||
in this revision of C++[.](#1.sentence-4)
|
||
|
||
[*Example [1](#example-1)*: int f(char *) = delete;int f(const char *);
|
||
string s;int x = f(s.data()); // ill-formed; previously well-formed â *end example*]
|