16 template <
typename string_viewT>
19 typedef string_viewT bridge_to_type;
20 typedef typename string_viewT::traits_type traits_type;
21 typedef typename string_viewT::value_type value_type;
22 typedef typename string_viewT::pointer pointer;
23 typedef typename string_viewT::const_pointer const_pointer;
24 typedef typename string_viewT::reference reference;
25 typedef typename string_viewT::const_reference const_reference;
26 typedef typename string_viewT::const_iterator const_iterator;
27 typedef typename string_viewT::iterator iterator;
28 typedef typename string_viewT::const_reverse_iterator const_reverse_iterator;
29 typedef typename string_viewT::reverse_iterator reverse_iterator;
30 typedef typename string_viewT::size_type size_type;
31 typedef typename string_viewT::difference_type difference_type;
32 static constexpr size_type npos = string_viewT::npos;
36 std::is_nothrow_constructible<string_viewT>::value) {}
38 std::is_nothrow_constructible<string_viewT, string_viewT>::value)
41 std::is_nothrow_copy_constructible<string_viewT>::value) =
default;
43 std::is_nothrow_constructible<string_viewT, const value_type*>::value)
46 std::is_nothrow_constructible<string_viewT,
52 std::is_nothrow_copy_assignable<string_viewT>::value) =
default;
55 noexcept(std::declval<string_viewT>().swap(s._sv))) {
59 constexpr
static bool is_nothrow_settable =
60 std::is_nothrow_assignable<string_viewT, string_viewT>::value &&
61 std::is_nothrow_constructible<string_viewT,
65 JASL_CONSTEXPR_CXX14
void set(
const value_type* str,
66 size_type len) noexcept(is_nothrow_settable) {
67 _sv = string_viewT(str, len);
71 operator string_viewT()
const noexcept {
return _sv; }
74 constexpr const_iterator begin()
const 75 noexcept(noexcept(std::declval<string_viewT>().begin())) {
78 constexpr const_iterator end()
const 79 noexcept(noexcept(std::declval<string_viewT>().end())) {
82 constexpr const_iterator cbegin()
const 83 noexcept(noexcept(std::declval<string_viewT>().cbegin())) {
86 constexpr const_iterator cend()
const 87 noexcept(noexcept(std::declval<string_viewT>().cend())) {
90 const_reverse_iterator rbegin()
const 91 noexcept(noexcept(std::declval<string_viewT>().rbegin())) {
94 const_reverse_iterator rend()
const 95 noexcept(noexcept(std::declval<string_viewT>().rend())) {
98 const_reverse_iterator crbegin()
const 99 noexcept(noexcept(std::declval<string_viewT>().crbegin())) {
100 return _sv.crbegin();
102 const_reverse_iterator crend()
const 103 noexcept(noexcept(std::declval<string_viewT>().crend())) {
107 constexpr size_type size()
const 108 noexcept(noexcept(std::declval<string_viewT>().size())) {
111 constexpr size_type length()
const 112 noexcept(noexcept(std::declval<string_viewT>().length())) {
115 constexpr size_type max_size()
const 116 noexcept(noexcept(std::declval<string_viewT>().max_size())) {
117 return _sv.max_size();
119 constexpr
bool empty()
const 120 noexcept(noexcept(std::declval<string_viewT>().empty())) {
124 constexpr const_reference operator[](size_type pos)
const 125 noexcept(noexcept(std::declval<string_viewT>()[pos])) {
128 constexpr const_reference at(size_type pos)
const 129 noexcept(noexcept(std::declval<string_viewT>().at(pos))) {
132 constexpr const_reference front()
const 133 noexcept(noexcept(std::declval<string_viewT>().front())) {
136 constexpr const_reference back()
const 137 noexcept(noexcept(std::declval<string_viewT>().back())) {
140 constexpr const_pointer data()
const 141 noexcept(noexcept(std::declval<string_viewT>().data())) {
145 JASL_CONSTEXPR_CXX14
void remove_prefix(size_type n) noexcept(
146 noexcept(std::declval<string_viewT>().remove_prefix(n))) {
147 _sv.remove_prefix(n);
149 JASL_CONSTEXPR_CXX14
void remove_suffix(size_type n) noexcept(
150 noexcept(std::declval<string_viewT>().remove_suffix(n))) {
151 _sv.remove_suffix(n);
154 size_type copy(value_type* s, size_type n)
const 155 noexcept(noexcept(std::declval<string_viewT>().copy(s, n))) {
156 return _sv.copy(s, n);
158 size_type copy(value_type* s, size_type n, size_type pos)
const 159 noexcept(noexcept(std::declval<string_viewT>().copy(s, n, pos))) {
160 return _sv.copy(s, n, pos);
164 noexcept(noexcept(std::declval<string_viewT>().substr(pos)) &&
165 std::is_nothrow_copy_constructible<string_viewT>::value &&
166 std::is_nothrow_copy_constructible<string_view_bridge>::value) {
170 noexcept(noexcept(std::declval<string_viewT>().substr(pos, n)) &&
171 std::is_nothrow_copy_constructible<string_viewT>::value &&
172 std::is_nothrow_copy_constructible<string_view_bridge>::value) {
176 noexcept(noexcept(std::declval<string_viewT>().compare(s._sv))) {
177 return _sv.compare(s._sv);
179 constexpr
int compare(size_type pos1,
183 noexcept(std::declval<string_viewT>().compare(pos1, n1, s._sv))) {
184 return _sv.compare(pos1, n1, s._sv);
186 constexpr
int compare(size_type pos1,
192 std::declval<string_viewT>().compare(pos1, n1, s._sv, pos2, n2))) {
193 return _sv.compare(pos1, n1, s._sv, pos2, n2);
195 constexpr
int compare(
const value_type* s)
const 196 noexcept(noexcept(std::declval<string_viewT>().compare(s))) {
197 return _sv.compare(s);
199 constexpr
int compare(size_type pos1, size_type n1,
const value_type* s)
const 200 noexcept(noexcept(std::declval<string_viewT>().compare(pos1, n1, s))) {
201 return _sv.compare(pos1, n1, s);
203 constexpr
int compare(size_type pos1,
208 noexcept(std::declval<string_viewT>().compare(pos1, n1, s, n2))) {
209 return _sv.compare(pos1, n1, s, n2);
212 noexcept(noexcept(std::declval<string_viewT>().find(s._sv))) {
213 return _sv.find(s._sv);
216 noexcept(noexcept(std::declval<string_viewT>().find(s._sv, pos))) {
217 return _sv.find(s._sv, pos);
219 constexpr size_type find(value_type c)
const 220 noexcept(noexcept(std::declval<string_viewT>().find(c))) {
223 constexpr size_type find(value_type c, size_type pos)
const 224 noexcept(noexcept(std::declval<string_viewT>().find(c, pos))) {
225 return _sv.find(c, pos);
227 constexpr size_type find(
const value_type* s,
230 noexcept(noexcept(std::declval<string_viewT>().find(s, pos, n))) {
231 return _sv.find(s, pos, n);
233 constexpr size_type find(
const value_type* s)
const 234 noexcept(noexcept(std::declval<string_viewT>().find(s))) {
237 constexpr size_type find(
const value_type* s, size_type pos)
const 238 noexcept(noexcept(std::declval<string_viewT>().find(s, pos))) {
239 return _sv.find(s, pos);
242 noexcept(noexcept(std::declval<string_viewT>().rfind(s._sv))) {
243 return _sv.rfind(s._sv);
246 noexcept(noexcept(std::declval<string_viewT>().rfind(s._sv, pos))) {
247 return _sv.rfind(s._sv, pos);
249 constexpr size_type rfind(value_type c)
const 250 noexcept(noexcept(std::declval<string_viewT>().rfind(c))) {
253 constexpr size_type rfind(value_type c, size_type pos)
const 254 noexcept(noexcept(std::declval<string_viewT>().rfind(c, pos))) {
255 return _sv.rfind(c, pos);
257 constexpr size_type rfind(
const value_type* s,
260 noexcept(noexcept(std::declval<string_viewT>().rfind(s, pos, n))) {
261 return _sv.rfind(s, pos, n);
263 constexpr size_type rfind(
const value_type* s)
const 264 noexcept(noexcept(std::declval<string_viewT>().rfind(s))) {
267 constexpr size_type rfind(
const value_type* s, size_type pos)
const 268 noexcept(noexcept(std::declval<string_viewT>().rfind(s, pos))) {
269 return _sv.rfind(s, pos);
272 noexcept(noexcept(std::declval<string_viewT>().find_first_of(s._sv))) {
273 return _sv.find_first_of(s._sv);
276 noexcept(noexcept(std::declval<string_viewT>().find_first_of(s._sv,
278 return _sv.find_first_of(s._sv, pos);
280 constexpr size_type find_first_of(value_type c)
const 281 noexcept(noexcept(std::declval<string_viewT>().find_first_of(c))) {
282 return _sv.find_first_of(c);
284 constexpr size_type find_first_of(value_type c, size_type pos)
const 285 noexcept(noexcept(std::declval<string_viewT>().find_first_of(c, pos))) {
286 return _sv.find_first_of(c, pos);
288 constexpr size_type find_first_of(
const value_type* s,
292 noexcept(std::declval<string_viewT>().find_first_of(s, pos, n))) {
293 return _sv.find_first_of(s, pos, n);
295 constexpr size_type find_first_of(
const value_type* s)
const 296 noexcept(noexcept(std::declval<string_viewT>().find_first_of(s))) {
297 return _sv.find_first_of(s);
299 constexpr size_type find_first_of(
const value_type* s, size_type pos)
const 300 noexcept(noexcept(std::declval<string_viewT>().find_first_of(s, pos))) {
301 return _sv.find_first_of(s, pos);
304 noexcept(noexcept(std::declval<string_viewT>().find_last_of(s._sv))) {
305 return _sv.find_last_of(s._sv);
308 noexcept(noexcept(std::declval<string_viewT>().find_last_of(s._sv,
310 return _sv.find_last_of(s._sv, pos);
312 constexpr size_type find_last_of(value_type c)
const 313 noexcept(noexcept(std::declval<string_viewT>().find_last_of(c))) {
314 return _sv.find_last_of(c);
316 constexpr size_type find_last_of(value_type c, size_type pos)
const 317 noexcept(noexcept(std::declval<string_viewT>().find_last_of(c, pos))) {
318 return _sv.find_last_of(c, pos);
320 constexpr size_type find_last_of(
const value_type* s,
323 noexcept(noexcept(std::declval<string_viewT>().find_last_of(s, pos, n))) {
324 return _sv.find_last_of(s, pos, n);
326 constexpr size_type find_last_of(
const value_type* s)
const 327 noexcept(noexcept(std::declval<string_viewT>().find_last_of(s))) {
328 return _sv.find_last_of(s);
330 constexpr size_type find_last_of(
const value_type* s, size_type pos)
const 331 noexcept(noexcept(std::declval<string_viewT>().find_last_of(s, pos))) {
332 return _sv.find_last_of(s, pos);
335 noexcept(std::declval<string_viewT>().find_first_not_of(s._sv))) {
336 return _sv.find_first_not_of(s._sv);
340 noexcept(noexcept(std::declval<string_viewT>().find_first_not_of(s._sv,
342 return _sv.find_first_not_of(s._sv, pos);
344 constexpr size_type find_first_not_of(value_type c)
const 345 noexcept(noexcept(std::declval<string_viewT>().find_first_not_of(c))) {
346 return _sv.find_first_not_of(c);
348 constexpr size_type find_first_not_of(value_type c, size_type pos)
const 349 noexcept(noexcept(std::declval<string_viewT>().find_first_not_of(c,
351 return _sv.find_first_not_of(c, pos);
353 constexpr size_type find_first_not_of(
const value_type* s,
357 noexcept(std::declval<string_viewT>().find_first_not_of(s, pos, n))) {
358 return _sv.find_first_not_of(s, pos, n);
360 constexpr size_type find_first_not_of(
const value_type* s)
const 361 noexcept(noexcept(std::declval<string_viewT>().find_first_not_of(s))) {
362 return _sv.find_first_not_of(s);
364 constexpr size_type find_first_not_of(
const value_type* s,
366 noexcept(noexcept(std::declval<string_viewT>().find_first_not_of(s,
368 return _sv.find_first_not_of(s, pos);
371 noexcept(noexcept(std::declval<string_viewT>().find_last_not_of(s._sv))) {
372 return _sv.find_last_not_of(s._sv);
376 noexcept(noexcept(std::declval<string_viewT>().find_last_not_of(s._sv,
378 return _sv.find_last_not_of(s._sv, pos);
380 constexpr size_type find_last_not_of(value_type c)
const 381 noexcept(noexcept(std::declval<string_viewT>().find_last_not_of(c))) {
382 return _sv.find_last_not_of(c);
384 constexpr size_type find_last_not_of(value_type c, size_type pos)
const 385 noexcept(noexcept(std::declval<string_viewT>().find_last_not_of(c,
387 return _sv.find_last_not_of(c, pos);
389 constexpr size_type find_last_not_of(
const value_type* s,
393 noexcept(std::declval<string_viewT>().find_last_not_of(s, pos, n))) {
394 return _sv.find_last_not_of(s, pos, n);
396 constexpr size_type find_last_not_of(
const value_type* s)
const 397 noexcept(noexcept(std::declval<string_viewT>().find_last_not_of(s))) {
398 return _sv.find_last_not_of(s);
400 constexpr size_type find_last_not_of(
const value_type* s, size_type pos)
const 401 noexcept(noexcept(std::declval<string_viewT>().find_last_not_of(s,
403 return _sv.find_last_not_of(s, pos);
406 noexcept(noexcept(std::declval<string_viewT>().starts_with(s._sv))) {
407 return _sv.starts_with(s._sv);
409 constexpr
bool starts_with(value_type c)
const 410 noexcept(noexcept(std::declval<string_viewT>().starts_with(c))) {
411 return _sv.starts_with(c);
413 constexpr
bool starts_with(
const value_type* s)
const 414 noexcept(noexcept(std::declval<string_viewT>().starts_with(s))) {
415 return _sv.starts_with(s);
418 noexcept(noexcept(std::declval<string_viewT>().ends_with(s._sv))) {
419 return _sv.ends_with(s._sv);
421 constexpr
bool ends_with(value_type c)
const 422 noexcept(noexcept(std::declval<string_viewT>().ends_with(c))) {
423 return _sv.ends_with(c);
425 constexpr
bool ends_with(
const value_type* s)
const 426 noexcept(noexcept(std::declval<string_viewT>().ends_with(s))) {
427 return _sv.ends_with(s);
434 friend JASL_CONSTEXPR_CXX14
bool operator==(
438 return x._sv == y._sv;
440 friend JASL_CONSTEXPR_CXX14
bool operator!=(
444 return x._sv != y._sv;
446 friend JASL_CONSTEXPR_CXX14
bool operator<(
450 return x._sv < y._sv;
452 friend JASL_CONSTEXPR_CXX14
bool operator>(
456 return x._sv > y._sv;
458 friend JASL_CONSTEXPR_CXX14
bool operator<=(
462 return x._sv <= y._sv;
464 friend JASL_CONSTEXPR_CXX14
bool operator>=(
468 return x._sv >= y._sv;
471 friend JASL_CONSTEXPR_CXX14
bool operator==(
473 const string_viewT& y) noexcept(noexcept(x._sv == y)) {
476 friend JASL_CONSTEXPR_CXX14
bool operator!=(
478 const string_viewT& y) noexcept(noexcept(x._sv != y)) {
481 friend JASL_CONSTEXPR_CXX14
bool operator<(
483 const string_viewT& y) noexcept(noexcept(x._sv < y)) {
486 friend JASL_CONSTEXPR_CXX14
bool operator>(
488 const string_viewT& y) noexcept(noexcept(x._sv > y)) {
491 friend JASL_CONSTEXPR_CXX14
bool operator<=(
493 const string_viewT& y) noexcept(noexcept(x._sv <= y)) {
496 friend JASL_CONSTEXPR_CXX14
bool operator>=(
498 const string_viewT& y) noexcept(noexcept(x._sv >= y)) {
502 friend JASL_CONSTEXPR_CXX14
bool operator==(
503 const string_viewT& x,
508 friend JASL_CONSTEXPR_CXX14
bool operator!=(
509 const string_viewT& x,
514 friend JASL_CONSTEXPR_CXX14
bool operator<(
515 const string_viewT& x,
519 friend JASL_CONSTEXPR_CXX14
bool operator>(
520 const string_viewT& x,
524 friend JASL_CONSTEXPR_CXX14
bool operator<=(
525 const string_viewT& x,
530 friend JASL_CONSTEXPR_CXX14
bool operator>=(
531 const string_viewT& x,
537 friend std::basic_ostream<value_type, traits_type>& operator<<(
538 std::basic_ostream<value_type, traits_type>& os,
540 return os << str._sv;
543 friend struct ::std::hash<string_view_bridge>;
550 template <
typename string_viewT>
551 struct hash<
jasl::inner::string_view_bridge<string_viewT>> {
553 noexcept(noexcept(std::hash<string_viewT>{}(x._sv))) {
554 return std::hash<string_viewT>{}(x._sv);
Definition: jasl_static_string.hpp:18
Definition: jasl_string_view_bridge.hpp:17
Definition: jasl_string_view.hpp:401