tmp/tmpywhn42l0/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,18 @@
|
|
| 1 |
-
### `basic_string` element access <a id="string.access">[[string.access]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
const_reference operator[](size_type pos) const;
|
| 5 |
reference operator[](size_type pos);
|
| 6 |
```
|
| 7 |
|
| 8 |
*Requires:* `pos <= size()`.
|
| 9 |
|
| 10 |
*Returns:* `*(begin() + pos)` if `pos < size()`. Otherwise, returns a
|
| 11 |
reference to an object of type `charT` with value `charT()`, where
|
| 12 |
-
modifying the object
|
|
|
|
| 13 |
|
| 14 |
*Throws:* Nothing.
|
| 15 |
|
| 16 |
*Complexity:* Constant time.
|
| 17 |
|
|
@@ -27,18 +28,18 @@ reference at(size_type pos);
|
|
| 27 |
``` cpp
|
| 28 |
const charT& front() const;
|
| 29 |
charT& front();
|
| 30 |
```
|
| 31 |
|
| 32 |
-
*Requires:* `!empty()`
|
| 33 |
|
| 34 |
-
*Effects:* Equivalent to `operator[](0)`
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
const charT& back() const;
|
| 38 |
charT& back();
|
| 39 |
```
|
| 40 |
|
| 41 |
-
*Requires:* `!empty()`
|
| 42 |
|
| 43 |
-
*Effects:* Equivalent to `operator[](size() - 1)`
|
| 44 |
|
|
|
|
| 1 |
+
#### `basic_string` element access <a id="string.access">[[string.access]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
const_reference operator[](size_type pos) const;
|
| 5 |
reference operator[](size_type pos);
|
| 6 |
```
|
| 7 |
|
| 8 |
*Requires:* `pos <= size()`.
|
| 9 |
|
| 10 |
*Returns:* `*(begin() + pos)` if `pos < size()`. Otherwise, returns a
|
| 11 |
reference to an object of type `charT` with value `charT()`, where
|
| 12 |
+
modifying the object to any value other than `charT()` leads to
|
| 13 |
+
undefined behavior.
|
| 14 |
|
| 15 |
*Throws:* Nothing.
|
| 16 |
|
| 17 |
*Complexity:* Constant time.
|
| 18 |
|
|
|
|
| 28 |
``` cpp
|
| 29 |
const charT& front() const;
|
| 30 |
charT& front();
|
| 31 |
```
|
| 32 |
|
| 33 |
+
*Requires:* `!empty()`.
|
| 34 |
|
| 35 |
+
*Effects:* Equivalent to: `return operator[](0);`
|
| 36 |
|
| 37 |
``` cpp
|
| 38 |
const charT& back() const;
|
| 39 |
charT& back();
|
| 40 |
```
|
| 41 |
|
| 42 |
+
*Requires:* `!empty()`.
|
| 43 |
|
| 44 |
+
*Effects:* Equivalent to: `return operator[](size() - 1);`
|
| 45 |
|