From Jason Turner

[string.view.access]

Diff to HTML by rtfpessoa

tmp/tmpffp6mc7a/{from.md → to.md} RENAMED
@@ -2,11 +2,11 @@
2
 
3
  ``` cpp
4
  constexpr const_reference operator[](size_type pos) const;
5
  ```
6
 
7
- *Requires:* `pos < size()`.
8
 
9
  *Returns:* `data_[pos]`.
10
 
11
  *Throws:* Nothing.
12
 
@@ -24,21 +24,21 @@ constexpr const_reference at(size_type pos) const;
24
 
25
  ``` cpp
26
  constexpr const_reference front() const;
27
  ```
28
 
29
- *Requires:* `!empty()`.
30
 
31
  *Returns:* `data_[0]`.
32
 
33
  *Throws:* Nothing.
34
 
35
  ``` cpp
36
  constexpr const_reference back() const;
37
  ```
38
 
39
- *Requires:* `!empty()`.
40
 
41
  *Returns:* `data_[size() - 1]`.
42
 
43
  *Throws:* Nothing.
44
 
@@ -46,10 +46,11 @@ constexpr const_reference back() const;
46
  constexpr const_pointer data() const noexcept;
47
  ```
48
 
49
  *Returns:* `data_`.
50
 
51
- [*Note 2*: Unlike `basic_string::data()` and string literals, `data()`
52
- may return a pointer to a buffer that is not null-terminated. Therefore
53
- it is typically a mistake to pass `data()` to a function that takes just
54
- a `const charT*` and expects a null-terminated string. — *end note*]
 
55
 
 
2
 
3
  ``` cpp
4
  constexpr const_reference operator[](size_type pos) const;
5
  ```
6
 
7
+ *Preconditions:* `pos < size()`.
8
 
9
  *Returns:* `data_[pos]`.
10
 
11
  *Throws:* Nothing.
12
 
 
24
 
25
  ``` cpp
26
  constexpr const_reference front() const;
27
  ```
28
 
29
+ *Preconditions:* `!empty()`.
30
 
31
  *Returns:* `data_[0]`.
32
 
33
  *Throws:* Nothing.
34
 
35
  ``` cpp
36
  constexpr const_reference back() const;
37
  ```
38
 
39
+ *Preconditions:* `!empty()`.
40
 
41
  *Returns:* `data_[size() - 1]`.
42
 
43
  *Throws:* Nothing.
44
 
 
46
  constexpr const_pointer data() const noexcept;
47
  ```
48
 
49
  *Returns:* `data_`.
50
 
51
+ [*Note 2*: Unlike `basic_string::data()` and *string-literal*s,
52
+ `data()` may return a pointer to a buffer that is not null-terminated.
53
+ Therefore it is typically a mistake to pass `data()` to a function that
54
+ takes just a `const charT*` and expects a null-terminated
55
+ string. — *end note*]
56