16 #ifndef RWrap_libcpp_string_view_h
17 #define RWrap_libcpp_string_view_h
45 #define _ROOT_LIBCPP_BEGIN_NAMESPACE_LFTS \
47 namespace experimental { inline namespace __ROOT {
48 #define _ROOT_LIBCPP_END_NAMESPACE_LFTS } } }
52 #define _ROOT_LIBCPP_BEGIN_NAMESPACE_LFTS \
54 namespace experimental { namespace __ROOT {
55 #define _ROOT_LIBCPP_END_NAMESPACE_LFTS } using namespace __ROOT; } }
60 #ifndef _LIBCPP_BEGIN_NAMESPACE_STD
61 #define _LOCAL_LIBCPP_BEGIN_NAMESPACE_STD
62 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
63 #define _LIBCPP_END_NAMESPACE_STD }
66 #ifndef _LIBCPP_CONSTEXPR
67 #define _LOCAL_LIBCPP_CONSTEXPR
68 #define _LIBCPP_CONSTEXPR constexpr
76 #ifndef _LIBCPP_INLINE_VISIBILITY
77 #define _LOCAL_LIBCPP_INLINE_VISIBILITY
78 #define _LIBCPP_INLINE_VISIBILITY inline
81 #ifndef _LIBCPP_EXPLICIT
82 #define _LOCAL_LIBCPP_EXPLICIT
83 #define _LIBCPP_EXPLICIT explicit
91 #ifdef _LIBCPP_STD_VER
92 #define _LOCAL_LIBCPP_STD_VER
93 #define _LIBCPP_STD_VER 11
96 #ifndef _LIBCPP_TYPE_VIS_ONLY
97 #define _LOCAL_LIBCPP_TYPE_VIS_ONLY
98 #define _LIBCPP_TYPE_VIS_ONLY
101 #ifndef _LIBCPP_CONSTEXPR_AFTER_CXX11
102 #define _LOCAL_LIBCPP_CONSTEXPR_AFTER_CXX11
103 #define _LIBCPP_CONSTEXPR_AFTER_CXX11
107 #define _LOCAL_NOEXCEPT
111 #ifndef _LIBCPP_ASSERT
112 #define _LOCAL_LIBCPP_ASSERT
113 #define _LIBCPP_ASSERT(X,Y) ((void)0)
123 inline namespace __ROOT {
126 inline namespace __1 {
138 template<
class _CharT,
class _Traits>
139 basic_ostream<_CharT, _Traits>&
141 const _CharT* __str,
size_t __len)
147 #endif // _LIBCPP_NO_EXCEPTIONS
148 typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
151 typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
152 if (__pad_and_output(_Ip(__os),
154 (__os.flags() & ios_base::adjustfield) == ios_base::left ?
159 __os.fill()).failed())
160 __os.setstate(ios_base::badbit | ios_base::failbit);
167 __os.__set_badbit_and_consider_rethrow();
169 #endif // _LIBCPP_NO_EXCEPTIONS
176 template <
class _BinaryPredicate,
class _ForwardIterator1,
class _ForwardIterator2>
178 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
179 _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
180 forward_iterator_tag, forward_iterator_tag)
182 if (__first2 == __last2)
189 if (__first1 == __last1)
191 if (__pred(*__first1, *__first2))
196 _ForwardIterator1 __m1 = __first1;
197 _ForwardIterator2 __m2 = __first2;
200 if (++__m2 == __last2)
202 if (++__m1 == __last1)
204 if (!__pred(*__m1, *__m2))
213 template <
class _BinaryPredicate,
class _RandomAccessIterator1,
class _RandomAccessIterator2>
215 __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
216 _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
217 random_access_iterator_tag, random_access_iterator_tag)
219 typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type _D1;
220 typedef typename std::iterator_traits<_RandomAccessIterator2>::difference_type _D2;
222 _D2 __len2 = __last2 - __first2;
225 _D1 __len1 = __last1 - __first1;
228 const _RandomAccessIterator1 __s = __last1 - (__len2 - 1);
231 #if !_LIBCPP_UNROLL_LOOPS
236 if (__pred(*__first1, *__first2))
240 #else // !_LIBCPP_UNROLL_LOOPS
241 for (_D1 __loop_unroll = (__s - __first1) / 4; __loop_unroll > 0; --__loop_unroll)
243 if (__pred(*__first1, *__first2))
245 if (__pred(*++__first1, *__first2))
247 if (__pred(*++__first1, *__first2))
249 if (__pred(*++__first1, *__first2))
253 switch (__s - __first1)
256 if (__pred(*__first1, *__first2))
260 if (__pred(*__first1, *__first2))
264 if (__pred(*__first1, *__first2))
270 #endif // !_LIBCPP_UNROLL_LOOPS
271 _RandomAccessIterator1 __m1 = __first1;
272 _RandomAccessIterator2 __m2 = __first2;
273 #if !_LIBCPP_UNROLL_LOOPS
276 if (++__m2 == __last2)
279 if (!__pred(*__m1, *__m2))
285 #else // !_LIBCPP_UNROLL_LOOPS
288 for (_D2 __loop_unroll = (__last2 - __m2) / 4; __loop_unroll > 0; --__loop_unroll)
290 if (!__pred(*__m1, *__m2))
292 if (!__pred(*++__m1, *++__m2))
294 if (!__pred(*++__m1, *++__m2))
296 if (!__pred(*++__m1, *++__m2))
301 switch (__last2 - __m2)
304 if (!__pred(*__m1, *__m2))
309 if (!__pred(*__m1, *__m2))
314 if (!__pred(*__m1, *__m2))
321 #endif // !_LIBCPP_UNROLL_LOOPS
325 #endif // _LOCAL_VSTD for __search
327 template <
class _ForwardIterator1,
class _ForwardIterator2,
class _BinaryPredicate>
330 _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
332 for (; __first1 != __last1; ++__first1)
333 for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
334 if (__pred(*__first1, *__j))
340 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
347 const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
350 return static_cast<_SizeT
>(__r - __p);
353 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
356 const _CharT* __s, _SizeT __pos, _SizeT __n)
358 if (__pos > __sz || __sz - __pos < __n)
364 __s, __s + __n, _Traits::eq,
365 random_access_iterator_tag(), random_access_iterator_tag());
366 if (__r == __p + __sz)
368 return static_cast<_SizeT
>(__r - __p);
374 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
377 _CharT __c, _SizeT __pos)
385 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
387 if (_Traits::eq(*--__ps, __c))
388 return static_cast<_SizeT
>(__ps - __p);
393 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
396 const _CharT* __s, _SizeT __pos, _SizeT __n)
399 if (__n < __sz - __pos)
403 const _CharT* __r = _VSTD::__find_end(
404 __p, __p + __pos, __s, __s + __n, _Traits::eq,
405 random_access_iterator_tag(), random_access_iterator_tag());
406 if (__n > 0 && __r == __p + __pos)
408 return static_cast<_SizeT
>(__r - __p);
412 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
415 const _CharT* __s, _SizeT __pos, _SizeT __n)
417 if (__pos >= __sz || __n == 0)
420 (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
421 if (__r == __p + __sz)
423 return static_cast<_SizeT
>(__r - __p);
428 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
431 const _CharT* __s, _SizeT __pos, _SizeT __n)
439 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
441 const _CharT* __r = _Traits::find(__s, __n, *--__ps);
443 return static_cast<_SizeT
>(__ps - __p);
451 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
454 const _CharT* __s, _SizeT __pos, _SizeT __n)
458 const _CharT* __pe = __p + __sz;
459 for (
const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
460 if (_Traits::find(__s, __n, *__ps) == 0)
461 return static_cast<_SizeT
>(__ps - __p);
467 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
470 _CharT __c, _SizeT __pos)
474 const _CharT* __pe = __p + __sz;
475 for (
const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
476 if (!_Traits::eq(*__ps, __c))
477 return static_cast<_SizeT
>(__ps - __p);
484 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
487 const _CharT* __s, _SizeT __pos, _SizeT __n)
493 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
494 if (_Traits::find(__s, __n, *--__ps) == 0)
495 return static_cast<_SizeT
>(__ps - __p);
500 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
503 _CharT __c, _SizeT __pos)
509 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
510 if (!_Traits::eq(*--__ps, __c))
511 return static_cast<_SizeT
>(__ps - __p);
524 #ifdef _LOCAL_LIBCPP_BEGIN_NAMESPACE_LFTS
525 #undef _LIBCPP_BEGIN_NAMESPACE_LFTS
526 #undef _LIBCPP_END_NAMESPACE_LFTS
529 #ifdef _LOCAL_LIBCPP_BEGIN_NAMESPACE_STD
530 #undef _LIBCPP_BEGIN_NAMESPACE_STD
531 #undef _LIBCPP_END_NAMESPACE_STD
534 #ifdef _LOCAL_LIBCPP_CONSTEXPR
535 #undef _LIBCPP_CONSTEXPR
542 #ifdef _LOCAL_LIBCPP_INLINE_VISIBILITY
543 #undef _LIBCPP_INLINE_VISIBILITY
546 #ifdef _LOCAL_LIBCPP_STD_VER
547 #undef _LIBCPP_STD_VER
550 #ifdef _LOCAL_LIBCPP_TYPE_VIS_ONLY
551 #undef _LIBCPP_TYPE_VIS_ONLY
554 #ifdef _LOCAL_LIBCPP_CONSTEXPR_AFTER_CXX11
555 #undef _LIBCPP_CONSTEXPR_AFTER_CXX11
558 #ifdef _LOCAL_NOEXCEPT
562 #ifdef _LOCAL_LIBCPP_ASSERT
563 #undef _LIBCPP_ASSERT
566 #endif // RWrap_libcpp_string_view_h
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY __str_find_first_not_of(const _CharT *__p, _SizeT __sz, const _CharT *__s, _SizeT __pos, _SizeT __n)
#define _LIBCPP_CONSTEXPR_AFTER_CXX11
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY __str_rfind(const _CharT *__p, _SizeT __sz, _CharT __c, _SizeT __pos)
_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1 __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag, random_access_iterator_tag)
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY __str_find_first_of(const _CharT *__p, _SizeT __sz, const _CharT *__s, _SizeT __pos, _SizeT __n)
#define _LIBCPP_INLINE_VISIBILITY
_ForwardIterator1 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag)
_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY __str_find_last_of(const _CharT *__p, _SizeT __sz, const _CharT *__s, _SizeT __pos, _SizeT __n)
basic_ostream< _CharT, _Traits > & R__put_character_sequence(basic_ostream< _CharT, _Traits > &__os, const _CharT *__str, size_t __len)
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY __str_find(const _CharT *__p, _SizeT __sz, _CharT __c, _SizeT __pos) _NOEXCEPT
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY __str_find_last_not_of(const _CharT *__p, _SizeT __sz, const _CharT *__s, _SizeT __pos, _SizeT __n)