From Jason Turner

[string.accessors]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprqhun5rr/{from.md → to.md} +14 -14
tmp/tmprqhun5rr/{from.md → to.md} RENAMED
@@ -1,41 +1,41 @@
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
  ```
7
 
8
- *Returns:* A pointer `p` such that `p + i == &operator[](i)` for each
9
- `i` in \[`0`, `size()`\].
10
 
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
40
  or, if that allocator has been replaced, a copy of the most recent
41
  replacement.
 
1
+ ##### Accessors <a id="string.accessors">[[string.accessors]]</a>
2
 
3
  ``` cpp
4
+ constexpr const charT* c_str() const noexcept;
5
+ constexpr const charT* data() const noexcept;
6
  ```
7
 
8
+ *Returns:* A pointer `p` such that `p + i == addressof(operator[](i))`
9
+ for each `i` in \[`0`, `size()`\].
10
 
11
  *Complexity:* Constant time.
12
 
13
+ *Remarks:* The program shall not modify any of the values stored in the
14
+ character array; otherwise, the behavior is undefined.
15
 
16
  ``` cpp
17
+ constexpr charT* data() noexcept;
18
  ```
19
 
20
+ *Returns:* A pointer `p` such that `p + i == addressof(operator[](i))`
21
+ for each `i` in \[`0`, `size()`\].
22
 
23
  *Complexity:* Constant time.
24
 
25
+ *Remarks:* The program shall not modify the value stored at `p + size()`
26
+ to any value other than `charT()`; otherwise, the behavior is undefined.
27
 
28
  ``` cpp
29
+ constexpr 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
+ constexpr allocator_type get_allocator() const noexcept;
37
  ```
38
 
39
  *Returns:* A copy of the `Allocator` object used to construct the string
40
  or, if that allocator has been replaced, a copy of the most recent
41
  replacement.