From Jason Turner

[diff.cpp14.string]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp85l_ep7r/{from.md → to.md} +17 -0
tmp/tmp85l_ep7r/{from.md → to.md} RENAMED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Clause [[strings]]: strings library <a id="diff.cpp14.string">[[diff.cpp14.string]]</a>
2
+
3
+ [[basic.string]] **Change:** Non-const `.data()` member added.
4
+ **Rationale:** The lack of a non-const `.data()` differed from the
5
+ similar member of `std::vector`. This change regularizes behavior for
6
+ this International Standard. **Effect on original feature:** Overloaded
7
+ functions which have differing code paths for `char*` and `const char*`
8
+ arguments will execute differently when called with a non-const string’s
9
+ `.data()` member in this International Standard.
10
+
11
+ ``` cpp
12
+ int f(char *) = delete;
13
+ int f(const char *);
14
+ string s;
15
+ int x = f(s.data()); // ill-formed; previously well-formed
16
+ ```
17
+