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 |
-
*
|
| 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 |
-
*
|
| 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 |
|
|
@@ -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
|
| 52 |
-
may return a pointer to a buffer that is not null-terminated.
|
| 53 |
-
it is typically a mistake to pass `data()` to a function that
|
| 54 |
-
a `const charT*` and expects a null-terminated
|
|
|
|
| 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 |
|