tmp/tmpc99ms4zl/{from.md → to.md}
RENAMED
|
@@ -2,53 +2,52 @@
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
constexpr const_reference operator[](size_type pos) const;
|
| 5 |
```
|
| 6 |
|
| 7 |
-
|
| 8 |
|
| 9 |
-
*
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
*Throws:* Nothing.
|
| 12 |
|
| 13 |
-
[*Note 1*: Unlike `basic_string::operator[]`,
|
| 14 |
-
`basic_string_view::operator[](size())` has undefined behavior instead
|
| 15 |
-
of returning `charT()`. — *end note*]
|
| 16 |
-
|
| 17 |
``` cpp
|
| 18 |
constexpr const_reference at(size_type pos) const;
|
| 19 |
```
|
| 20 |
|
| 21 |
-
*Returns:* `data_[pos]`.
|
| 22 |
|
| 23 |
*Throws:* `out_of_range` if `pos >= size()`.
|
| 24 |
|
| 25 |
``` cpp
|
| 26 |
constexpr const_reference front() const;
|
| 27 |
```
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
*Returns:* `data_[0]`.
|
| 32 |
|
| 33 |
*Throws:* Nothing.
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
constexpr const_reference back() const;
|
| 37 |
```
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
*Returns:* `data_[size() - 1]`.
|
| 42 |
|
| 43 |
*Throws:* Nothing.
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
constexpr const_pointer data() const noexcept;
|
| 47 |
```
|
| 48 |
|
| 49 |
-
*Returns:*
|
| 50 |
|
| 51 |
[*Note 2*: Unlike `basic_string::data()` and *string-literal*s,
|
| 52 |
`data()` can 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
|
|
|
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
constexpr const_reference operator[](size_type pos) const;
|
| 5 |
```
|
| 6 |
|
| 7 |
+
`pos < size()` is `true`.
|
| 8 |
|
| 9 |
+
[*Note 1*: This precondition is stronger than the one on
|
| 10 |
+
`basic_string::operator[]`. — *end note*]
|
| 11 |
+
|
| 12 |
+
*Returns:* *`data_`*`[pos]`.
|
| 13 |
|
| 14 |
*Throws:* Nothing.
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
``` cpp
|
| 17 |
constexpr const_reference at(size_type pos) const;
|
| 18 |
```
|
| 19 |
|
| 20 |
+
*Returns:* *`data_`*`[pos]`.
|
| 21 |
|
| 22 |
*Throws:* `out_of_range` if `pos >= size()`.
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
constexpr const_reference front() const;
|
| 26 |
```
|
| 27 |
|
| 28 |
+
`empty()` is `false`.
|
| 29 |
|
| 30 |
+
*Returns:* *`data_`*`[0]`.
|
| 31 |
|
| 32 |
*Throws:* Nothing.
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
constexpr const_reference back() const;
|
| 36 |
```
|
| 37 |
|
| 38 |
+
`empty()` is `false`.
|
| 39 |
|
| 40 |
+
*Returns:* *`data_`*`[size() - 1]`.
|
| 41 |
|
| 42 |
*Throws:* Nothing.
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
constexpr const_pointer data() const noexcept;
|
| 46 |
```
|
| 47 |
|
| 48 |
+
*Returns:* *data\_*.
|
| 49 |
|
| 50 |
[*Note 2*: Unlike `basic_string::data()` and *string-literal*s,
|
| 51 |
`data()` can return a pointer to a buffer that is not null-terminated.
|
| 52 |
Therefore it is typically a mistake to pass `data()` to a function that
|
| 53 |
takes just a `const charT*` and expects a null-terminated
|