34#ifndef _GLIBCXX_STRING_VIEW_TCC
35#define _GLIBCXX_STRING_VIEW_TCC 1
38#pragma GCC system_header
41#if __cplusplus >= 201703L
43namespace std _GLIBCXX_VISIBILITY(default)
45_GLIBCXX_BEGIN_NAMESPACE_VERSION
47 template<
typename _CharT,
typename _Traits>
48 constexpr typename basic_string_view<_CharT, _Traits>::size_type
52 __glibcxx_requires_string_len(__str, __n);
55 return __pos <= _M_len ? __pos : npos;
59 const _CharT __elem0 = __str[0];
60 const _CharT* __first = _M_str + __pos;
61 const _CharT*
const __last = _M_str + _M_len;
67 __first = traits_type::find(__first, __len - __n + 1, __elem0);
73 if (traits_type::compare(__first, __str, __n) == 0)
74 return __first - _M_str;
75 __len = __last - ++__first;
80 template<
typename _CharT,
typename _Traits>
81 constexpr typename basic_string_view<_CharT, _Traits>::size_type
86 if (__pos < this->_M_len)
88 const size_type __n = this->_M_len - __pos;
89 const _CharT* __p = traits_type::find(this->_M_str + __pos, __n, __c);
91 __ret = __p - this->_M_str;
96 template<
typename _CharT,
typename _Traits>
97 constexpr typename basic_string_view<_CharT, _Traits>::size_type
101 __glibcxx_requires_string_len(__str, __n);
103 if (__n <= this->_M_len)
108 if (traits_type::compare(this->_M_str + __pos, __str, __n) == 0)
116 template<
typename _CharT,
typename _Traits>
117 constexpr typename basic_string_view<_CharT, _Traits>::size_type
124 if (--__size > __pos)
126 for (++__size; __size-- > 0; )
127 if (traits_type::eq(this->_M_str[__size], __c))
133 template<
typename _CharT,
typename _Traits>
134 constexpr typename basic_string_view<_CharT, _Traits>::size_type
139 __glibcxx_requires_string_len(__str, __n);
140 for (; __n && __pos < this->_M_len; ++__pos)
142 const _CharT* __p = traits_type::find(__str, __n,
143 this->_M_str[__pos]);
150 template<
typename _CharT,
typename _Traits>
151 constexpr typename basic_string_view<_CharT, _Traits>::size_type
156 __glibcxx_requires_string_len(__str, __n);
160 if (--__size > __pos)
164 if (traits_type::find(__str, __n, this->_M_str[__size]))
167 while (__size-- != 0);
172 template<
typename _CharT,
typename _Traits>
173 constexpr typename basic_string_view<_CharT, _Traits>::size_type
178 __glibcxx_requires_string_len(__str, __n);
179 for (; __pos < this->_M_len; ++__pos)
180 if (!traits_type::find(__str, __n, this->_M_str[__pos]))
185 template<
typename _CharT,
typename _Traits>
186 constexpr typename basic_string_view<_CharT, _Traits>::size_type
190 for (; __pos < this->_M_len; ++__pos)
191 if (!traits_type::eq(this->_M_str[__pos], __c))
196 template<
typename _CharT,
typename _Traits>
197 constexpr typename basic_string_view<_CharT, _Traits>::size_type
202 __glibcxx_requires_string_len(__str, __n);
206 if (--__size > __pos)
210 if (!traits_type::find(__str, __n, this->_M_str[__size]))
218 template<
typename _CharT,
typename _Traits>
219 constexpr typename basic_string_view<_CharT, _Traits>::size_type
226 if (--__size > __pos)
230 if (!traits_type::eq(this->_M_str[__size], __c))
238_GLIBCXX_END_NAMESPACE_VERSION
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
ISO C++ entities toplevel namespace is std.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
A non-owning reference to a string.