From Jason Turner

[string.ops]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpwlu2qnvr/{from.md → to.md} +23 -7
tmp/tmpwlu2qnvr/{from.md → to.md} RENAMED
@@ -104,25 +104,27 @@ template<class T>
104
  ``` cpp
105
  basic_string_view<charT, traits> s = *this, sv = t;
106
  return s.G(sv, pos);
107
  ```
108
 
109
- *Remarks:* The expression inside `noexcept` is equivalent to
110
  `is_nothrow_convertible_v<const T&, basic_string_view<charT, traits>>`.
111
 
112
  ##### `basic_string::substr` <a id="string.substr">[[string.substr]]</a>
113
 
114
  ``` cpp
115
- constexpr basic_string substr(size_type pos = 0, size_type n = npos) const;
116
  ```
117
 
118
- *Throws:* `out_of_range` if `pos > size()`.
119
 
120
- *Effects:* Determines the effective length `rlen` of the string to copy
121
- as the smaller of `n` and `size() - pos`.
 
122
 
123
- *Returns:* `basic_string(data()+pos, rlen)`.
 
124
 
125
  ##### `basic_string::compare` <a id="string.compare">[[string.compare]]</a>
126
 
127
  ``` cpp
128
  template<class T>
@@ -136,11 +138,11 @@ template<class T>
136
  - `is_convertible_v<const T&, const charT*>` is `false`.
137
 
138
  *Effects:* Equivalent to:
139
  `return basic_string_view<charT, traits>(*this).compare(t);`
140
 
141
- *Remarks:* The expression inside `noexcept` is equivalent to
142
  `is_nothrow_convertible_v<const T&, basic_string_view<charT, traits>>`.
143
 
144
  ``` cpp
145
  template<class T>
146
  constexpr int compare(size_type pos1, size_type n1, const T& t) const;
@@ -249,5 +251,19 @@ constexpr bool ends_with(const charT* x) const;
249
 
250
  ``` cpp
251
  return basic_string_view<charT, traits>(data(), size()).ends_with(x);
252
  ```
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  ``` cpp
105
  basic_string_view<charT, traits> s = *this, sv = t;
106
  return s.G(sv, pos);
107
  ```
108
 
109
+ *Remarks:* The exception specification is equivalent to
110
  `is_nothrow_convertible_v<const T&, basic_string_view<charT, traits>>`.
111
 
112
  ##### `basic_string::substr` <a id="string.substr">[[string.substr]]</a>
113
 
114
  ``` cpp
115
+ constexpr basic_string substr(size_type pos = 0, size_type n = npos) const &;
116
  ```
117
 
118
+ *Effects:* Equivalent to: `return basic_string(*this, pos, n);`
119
 
120
+ ``` cpp
121
+ constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&;
122
+ ```
123
 
124
+ *Effects:* Equivalent to:
125
+ `return basic_string(std::move(*this), pos, n);`
126
 
127
  ##### `basic_string::compare` <a id="string.compare">[[string.compare]]</a>
128
 
129
  ``` cpp
130
  template<class T>
 
138
  - `is_convertible_v<const T&, const charT*>` is `false`.
139
 
140
  *Effects:* Equivalent to:
141
  `return basic_string_view<charT, traits>(*this).compare(t);`
142
 
143
+ *Remarks:* The exception specification is equivalent to
144
  `is_nothrow_convertible_v<const T&, basic_string_view<charT, traits>>`.
145
 
146
  ``` cpp
147
  template<class T>
148
  constexpr int compare(size_type pos1, size_type n1, const T& t) const;
 
251
 
252
  ``` cpp
253
  return basic_string_view<charT, traits>(data(), size()).ends_with(x);
254
  ```
255
 
256
+ ##### `basic_string::contains` <a id="string.contains">[[string.contains]]</a>
257
+
258
+ ``` cpp
259
+ constexpr bool contains(basic_string_view<charT, traits> x) const noexcept;
260
+ constexpr bool contains(charT x) const noexcept;
261
+ constexpr bool contains(const charT* x) const;
262
+ ```
263
+
264
+ *Effects:* Equivalent to:
265
+
266
+ ``` cpp
267
+ return basic_string_view<charT, traits>(data(), size()).contains(x);
268
+ ```
269
+