tmp/tmpxnn0x4j0/{from.md → to.md}
RENAMED
|
@@ -4,45 +4,43 @@
|
|
| 4 |
constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const;
|
| 5 |
```
|
| 6 |
|
| 7 |
Let `rlen` be the smaller of `n` and `size() - pos`.
|
| 8 |
|
| 9 |
-
*Throws:* `out_of_range` if `pos > size()`.
|
| 10 |
-
|
| 11 |
*Preconditions:* \[`s`, `s + rlen`) is a valid range.
|
| 12 |
|
| 13 |
*Effects:* Equivalent to `traits::copy(s, data() + pos, rlen)`.
|
| 14 |
|
| 15 |
*Returns:* `rlen`.
|
| 16 |
|
|
|
|
|
|
|
| 17 |
*Complexity:* 𝑂(`rlen`).
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
|
| 21 |
```
|
| 22 |
|
| 23 |
Let `rlen` be the smaller of `n` and `size() - pos`.
|
| 24 |
|
| 25 |
-
*Throws:* `out_of_range` if `pos > size()`.
|
| 26 |
-
|
| 27 |
*Effects:* Determines `rlen`, the effective length of the string to
|
| 28 |
reference.
|
| 29 |
|
| 30 |
*Returns:* `basic_string_view(data() + pos, rlen)`.
|
| 31 |
|
|
|
|
|
|
|
| 32 |
``` cpp
|
| 33 |
constexpr int compare(basic_string_view str) const noexcept;
|
| 34 |
```
|
| 35 |
|
| 36 |
Let `rlen` be the smaller of `size()` and `str.size()`.
|
| 37 |
|
| 38 |
*Effects:* Determines `rlen`, the effective length of the strings to
|
| 39 |
compare. The function then compares the two strings by calling
|
| 40 |
`traits::compare(data(), str.data(), rlen)`.
|
| 41 |
|
| 42 |
-
*Complexity:* 𝑂(`rlen`).
|
| 43 |
-
|
| 44 |
*Returns:* The nonzero result if the result of the comparison is
|
| 45 |
nonzero. Otherwise, returns a value as indicated in
|
| 46 |
[[string.view.compare]].
|
| 47 |
|
| 48 |
**Table: `compare()` results** <a id="string.view.compare">[string.view.compare]</a>
|
|
@@ -51,10 +49,13 @@ nonzero. Otherwise, returns a value as indicated in
|
|
| 51 |
| ---------------------- | ------------ |
|
| 52 |
| `size() < str.size()` | `< 0` |
|
| 53 |
| `size() == str.size()` | ` 0` |
|
| 54 |
| `size() > str.size()` | `> 0` |
|
| 55 |
|
|
|
|
|
|
|
|
|
|
| 56 |
``` cpp
|
| 57 |
constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const;
|
| 58 |
```
|
| 59 |
|
| 60 |
*Effects:* Equivalent to: `return substr(pos1, n1).compare(str);`
|
|
@@ -125,5 +126,13 @@ constexpr bool ends_with(charT x) const noexcept;
|
|
| 125 |
constexpr bool ends_with(const charT* x) const;
|
| 126 |
```
|
| 127 |
|
| 128 |
*Effects:* Equivalent to: `return ends_with(basic_string_view(x));`
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const;
|
| 5 |
```
|
| 6 |
|
| 7 |
Let `rlen` be the smaller of `n` and `size() - pos`.
|
| 8 |
|
|
|
|
|
|
|
| 9 |
*Preconditions:* \[`s`, `s + rlen`) is a valid range.
|
| 10 |
|
| 11 |
*Effects:* Equivalent to `traits::copy(s, data() + pos, rlen)`.
|
| 12 |
|
| 13 |
*Returns:* `rlen`.
|
| 14 |
|
| 15 |
+
*Throws:* `out_of_range` if `pos > size()`.
|
| 16 |
+
|
| 17 |
*Complexity:* 𝑂(`rlen`).
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
|
| 21 |
```
|
| 22 |
|
| 23 |
Let `rlen` be the smaller of `n` and `size() - pos`.
|
| 24 |
|
|
|
|
|
|
|
| 25 |
*Effects:* Determines `rlen`, the effective length of the string to
|
| 26 |
reference.
|
| 27 |
|
| 28 |
*Returns:* `basic_string_view(data() + pos, rlen)`.
|
| 29 |
|
| 30 |
+
*Throws:* `out_of_range` if `pos > size()`.
|
| 31 |
+
|
| 32 |
``` cpp
|
| 33 |
constexpr int compare(basic_string_view str) const noexcept;
|
| 34 |
```
|
| 35 |
|
| 36 |
Let `rlen` be the smaller of `size()` and `str.size()`.
|
| 37 |
|
| 38 |
*Effects:* Determines `rlen`, the effective length of the strings to
|
| 39 |
compare. The function then compares the two strings by calling
|
| 40 |
`traits::compare(data(), str.data(), rlen)`.
|
| 41 |
|
|
|
|
|
|
|
| 42 |
*Returns:* The nonzero result if the result of the comparison is
|
| 43 |
nonzero. Otherwise, returns a value as indicated in
|
| 44 |
[[string.view.compare]].
|
| 45 |
|
| 46 |
**Table: `compare()` results** <a id="string.view.compare">[string.view.compare]</a>
|
|
|
|
| 49 |
| ---------------------- | ------------ |
|
| 50 |
| `size() < str.size()` | `< 0` |
|
| 51 |
| `size() == str.size()` | ` 0` |
|
| 52 |
| `size() > str.size()` | `> 0` |
|
| 53 |
|
| 54 |
+
|
| 55 |
+
*Complexity:* 𝑂(`rlen`).
|
| 56 |
+
|
| 57 |
``` cpp
|
| 58 |
constexpr int compare(size_type pos1, size_type n1, basic_string_view str) const;
|
| 59 |
```
|
| 60 |
|
| 61 |
*Effects:* Equivalent to: `return substr(pos1, n1).compare(str);`
|
|
|
|
| 126 |
constexpr bool ends_with(const charT* x) const;
|
| 127 |
```
|
| 128 |
|
| 129 |
*Effects:* Equivalent to: `return ends_with(basic_string_view(x));`
|
| 130 |
|
| 131 |
+
``` cpp
|
| 132 |
+
constexpr bool contains(basic_string_view x) const noexcept;
|
| 133 |
+
constexpr bool contains(charT x) const noexcept;
|
| 134 |
+
constexpr bool contains(const charT* x) const;
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
*Effects:* Equivalent to: `return find(x) != npos;`
|
| 138 |
+
|