From Jason Turner

[string.accessors]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcz5duk7n/{from.md → to.md} +20 -1
tmp/tmpcz5duk7n/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- #### `basic_string` accessors <a id="string.accessors">[[string.accessors]]</a>
2
 
3
  ``` cpp
4
  const charT* c_str() const noexcept;
5
  const charT* data() const noexcept;
6
  ```
@@ -11,10 +11,29 @@ const charT* data() const noexcept;
11
  *Complexity:* Constant time.
12
 
13
  *Requires:* The program shall not alter any of the values stored in the
14
  character array.
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  ``` cpp
17
  allocator_type get_allocator() const noexcept;
18
  ```
19
 
20
  *Returns:* A copy of the `Allocator` object used to construct the string
 
1
+ ##### `basic_string` accessors <a id="string.accessors">[[string.accessors]]</a>
2
 
3
  ``` cpp
4
  const charT* c_str() const noexcept;
5
  const charT* data() const noexcept;
6
  ```
 
11
  *Complexity:* Constant time.
12
 
13
  *Requires:* The program shall not alter any of the values stored in the
14
  character array.
15
 
16
+ ``` cpp
17
+ charT* data() noexcept;
18
+ ```
19
+
20
+ *Returns:* A pointer `p` such that `p + i == &operator[](i)` for each
21
+ `i` in \[`0`, `size()`\].
22
+
23
+ *Complexity:* Constant time.
24
+
25
+ *Requires:* The program shall not alter the value stored at
26
+ `p + size()`.
27
+
28
+ ``` cpp
29
+ operator basic_string_view<charT, traits>() const noexcept;
30
+ ```
31
+
32
+ *Effects:* Equivalent to:
33
+ `return basic_string_view<charT, traits>(data(), size());`
34
+
35
  ``` cpp
36
  allocator_type get_allocator() const noexcept;
37
  ```
38
 
39
  *Returns:* A copy of the `Allocator` object used to construct the string