tmp/tmpdc38pps5/{from.md → to.md}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
const_reference operator[](size_type pos) const;
|
| 5 |
-
reference operator[](size_type pos);
|
| 6 |
```
|
| 7 |
|
| 8 |
-
*
|
| 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.
|
|
@@ -15,31 +15,31 @@ undefined behavior.
|
|
| 15 |
*Throws:* Nothing.
|
| 16 |
|
| 17 |
*Complexity:* Constant time.
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
-
const_reference at(size_type pos) const;
|
| 21 |
-
reference at(size_type pos);
|
| 22 |
```
|
| 23 |
|
| 24 |
*Throws:* `out_of_range` if `pos >= size()`.
|
| 25 |
|
| 26 |
*Returns:* `operator[](pos)`.
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
-
const charT& front() const;
|
| 30 |
-
charT& front();
|
| 31 |
```
|
| 32 |
|
| 33 |
-
*
|
| 34 |
|
| 35 |
*Effects:* Equivalent to: `return operator[](0);`
|
| 36 |
|
| 37 |
``` cpp
|
| 38 |
-
const charT& back() const;
|
| 39 |
-
charT& back();
|
| 40 |
```
|
| 41 |
|
| 42 |
-
*
|
| 43 |
|
| 44 |
*Effects:* Equivalent to: `return operator[](size() - 1);`
|
| 45 |
|
|
|
|
| 1 |
+
#### Element access <a id="string.access">[[string.access]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
constexpr const_reference operator[](size_type pos) const;
|
| 5 |
+
constexpr reference operator[](size_type pos);
|
| 6 |
```
|
| 7 |
|
| 8 |
+
*Preconditions:* `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.
|
|
|
|
| 15 |
*Throws:* Nothing.
|
| 16 |
|
| 17 |
*Complexity:* Constant time.
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
+
constexpr const_reference at(size_type pos) const;
|
| 21 |
+
constexpr reference at(size_type pos);
|
| 22 |
```
|
| 23 |
|
| 24 |
*Throws:* `out_of_range` if `pos >= size()`.
|
| 25 |
|
| 26 |
*Returns:* `operator[](pos)`.
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
+
constexpr const charT& front() const;
|
| 30 |
+
constexpr charT& front();
|
| 31 |
```
|
| 32 |
|
| 33 |
+
*Preconditions:* `!empty()`.
|
| 34 |
|
| 35 |
*Effects:* Equivalent to: `return operator[](0);`
|
| 36 |
|
| 37 |
``` cpp
|
| 38 |
+
constexpr const charT& back() const;
|
| 39 |
+
constexpr charT& back();
|
| 40 |
```
|
| 41 |
|
| 42 |
+
*Preconditions:* `!empty()`.
|
| 43 |
|
| 44 |
*Effects:* Equivalent to: `return operator[](size() - 1);`
|
| 45 |
|