Files
2025-10-25 03:02:53 +03:00

36 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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 "27Strings 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*]