tmp/tmphe6vcd51/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Searching <a id="string.view.find">[[string.view.find]]</a>
|
| 2 |
+
|
| 3 |
+
This section specifies the `basic_string_view` member functions named
|
| 4 |
+
`find`, `rfind`, `find_first_of`, `find_last_of`, `find_first_not_of`,
|
| 5 |
+
and `find_last_not_of`.
|
| 6 |
+
|
| 7 |
+
Member functions in this section have complexity
|
| 8 |
+
𝑂(`size() * str.size()`) at worst, although implementations are
|
| 9 |
+
encouraged to do better.
|
| 10 |
+
|
| 11 |
+
Each member function of the form
|
| 12 |
+
|
| 13 |
+
``` cpp
|
| 14 |
+
constexpr return-type F(const charT* s, size_type pos);
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
is equivalent to `return F(basic_string_view(s), pos);`
|
| 18 |
+
|
| 19 |
+
Each member function of the form
|
| 20 |
+
|
| 21 |
+
``` cpp
|
| 22 |
+
constexpr return-type F(const charT* s, size_type pos, size_type n);
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
is equivalent to `return F(basic_string_view(s, n), pos);`
|
| 26 |
+
|
| 27 |
+
Each member function of the form
|
| 28 |
+
|
| 29 |
+
``` cpp
|
| 30 |
+
constexpr return-type F(charT c, size_type pos);
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
is equivalent to `return F(basic_string_view(&c, 1), pos);`
|
| 34 |
+
|
| 35 |
+
``` cpp
|
| 36 |
+
constexpr size_type find(basic_string_view str, size_type pos = 0) const noexcept;
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
Let `xpos` be the lowest position, if possible, such that the following
|
| 40 |
+
conditions hold:
|
| 41 |
+
|
| 42 |
+
- `pos <= xpos`
|
| 43 |
+
- `xpos + str.size() <= size()`
|
| 44 |
+
- `traits::eq(at(xpos + I), str.at(I))` for all elements `I` of the
|
| 45 |
+
string referenced by `str`.
|
| 46 |
+
|
| 47 |
+
*Effects:* Determines `xpos`.
|
| 48 |
+
|
| 49 |
+
*Returns:* `xpos` if the function can determine such a value for `xpos`.
|
| 50 |
+
Otherwise, returns `npos`.
|
| 51 |
+
|
| 52 |
+
``` cpp
|
| 53 |
+
constexpr size_type rfind(basic_string_view str, size_type pos = npos) const noexcept;
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Let `xpos` be the highest position, if possible, such that the following
|
| 57 |
+
conditions hold:
|
| 58 |
+
|
| 59 |
+
- `xpos <= pos`
|
| 60 |
+
- `xpos + str.size() <= size()`
|
| 61 |
+
- `traits::eq(at(xpos + I), str.at(I))` for all elements `I` of the
|
| 62 |
+
string referenced by `str`.
|
| 63 |
+
|
| 64 |
+
*Effects:* Determines `xpos`.
|
| 65 |
+
|
| 66 |
+
*Returns:* `xpos` if the function can determine such a value for `xpos`.
|
| 67 |
+
Otherwise, returns `npos`.
|
| 68 |
+
|
| 69 |
+
``` cpp
|
| 70 |
+
constexpr size_type find_first_of(basic_string_view str, size_type pos = 0) const noexcept;
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
Let `xpos` be the lowest position, if possible, such that the following
|
| 74 |
+
conditions hold:
|
| 75 |
+
|
| 76 |
+
- `pos <= xpos`
|
| 77 |
+
- `xpos < size()`
|
| 78 |
+
- `traits::eq(at(xpos), str.at(I))` for some element `I` of the string
|
| 79 |
+
referenced by `str`.
|
| 80 |
+
|
| 81 |
+
*Effects:* Determines `xpos`.
|
| 82 |
+
|
| 83 |
+
*Returns:* `xpos` if the function can determine such a value for `xpos`.
|
| 84 |
+
Otherwise, returns `npos`.
|
| 85 |
+
|
| 86 |
+
``` cpp
|
| 87 |
+
constexpr size_type find_last_of(basic_string_view str, size_type pos = npos) const noexcept;
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
Let `xpos` be the highest position, if possible, such that the following
|
| 91 |
+
conditions hold:
|
| 92 |
+
|
| 93 |
+
- `xpos <= pos`
|
| 94 |
+
- `xpos < size()`
|
| 95 |
+
- `traits::eq(at(xpos), str.at(I))` for some element `I` of the string
|
| 96 |
+
referenced by `str`.
|
| 97 |
+
|
| 98 |
+
*Effects:* Determines `xpos`.
|
| 99 |
+
|
| 100 |
+
*Returns:* `xpos` if the function can determine such a value for `xpos`.
|
| 101 |
+
Otherwise, returns `npos`.
|
| 102 |
+
|
| 103 |
+
``` cpp
|
| 104 |
+
constexpr size_type find_first_not_of(basic_string_view str, size_type pos = 0) const noexcept;
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
Let `xpos` be the lowest position, if possible, such that the following
|
| 108 |
+
conditions hold:
|
| 109 |
+
|
| 110 |
+
- `pos <= xpos`
|
| 111 |
+
- `xpos < size()`
|
| 112 |
+
- `traits::eq(at(xpos), str.at(I))` for no element `I` of the string
|
| 113 |
+
referenced by `str`.
|
| 114 |
+
|
| 115 |
+
*Effects:* Determines `xpos`.
|
| 116 |
+
|
| 117 |
+
*Returns:* `xpos` if the function can determine such a value for `xpos`.
|
| 118 |
+
Otherwise, returns `npos`.
|
| 119 |
+
|
| 120 |
+
``` cpp
|
| 121 |
+
constexpr size_type find_last_not_of(basic_string_view str, size_type pos = npos) const noexcept;
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
Let `xpos` be the highest position, if possible, such that the following
|
| 125 |
+
conditions hold:
|
| 126 |
+
|
| 127 |
+
- `xpos <= pos`
|
| 128 |
+
- `xpos < size()`
|
| 129 |
+
- `traits::eq(at(xpos), str.at(I))` for no element `I` of the string
|
| 130 |
+
referenced by `str`.
|
| 131 |
+
|
| 132 |
+
*Effects:* Determines `xpos`.
|
| 133 |
+
|
| 134 |
+
*Returns:* `xpos` if the function can determine such a value for `xpos`.
|
| 135 |
+
Otherwise, returns `npos`.
|
| 136 |
+
|