YSTest: string_view.hpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

string_view.hpp
浏览该文件的文档.
1 /*
2 © 2015-2020 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
36 #ifndef YB_INC_ystdex_string_view_hpp_
37 #define YB_INC_ystdex_string_view_hpp_ 1
38
39 #include "range.hpp" // "range.hpp", ystdex::reverse_iterator;
40 // NOTE: See "placement.hpp" for comments on inclusion conditions.
41 #if (YB_IMPL_MSCPP >= 1910 && _MSVC_LANG >= 201603) \
42 || (__cplusplus >= 201703L && __has_include(<string_view>))
43 # include <string_view>
44 // NOTE: Since WG21 P0941R2, the macro value is combined as '201606L' with WG21
45 // P0254R2 support which is not used here, so the check remains the value in
46 // WG21 P0941R1.
47 # if (YB_IMPL_MSCPP >= 1910 && _MSVC_LANG >= 201603) \
48 || __cpp_lib_string_view >= 201603L
49 # define YB_Has_string_view 1
50 # endif
51 #endif
52 #if YB_Has_string_view == 1
53 # include <libdefect/string.h>
54 #else
55 # include "cstring.h" // for std::char_traits, std::allocator, 'str_find*',
56 // 'str_rfind*', std::basic_ostream, std::basic_string;
57 # include "operators.hpp" // for totally_ordered;
58 # include <limits> // for std::numeric_limits;
59 # include <stdexcept> // for std::out_of_range;
60 # include "hash.hpp" // for std::hash, ystdex::hash_range;
61 #endif
62
71 #ifndef __cpp_lib_string_view
72 # if (YB_IMPL_MSCPP >= 1910 && _MSVC_LANG >= 201606) || __cplusplus >= 201606L
73 # define __cpp_lib_string_view 201606L
74 # endif
75 #endif
76
77
78 namespace ystdex
79 {
80
82 inline namespace cpp2017
83 {
84
85 #if YB_Has_string_view == 1
86 using std::basic_string_view;
88 #else
89
91 template<typename _tChar, class _tTraits = std::char_traits<_tChar>>
93 class basic_string_view
94 : yimpl(private totally_ordered<basic_string_view<_tChar, _tTraits>>)
95 {
96 public:
97 using traits_type = _tTraits;
98 using value_type = _tChar;
99 using pointer = _tChar*;
100 using const_pointer = const _tChar*;
101 using reference = _tChar&;
102 using const_reference = const _tChar&;
103 using const_iterator = yimpl(const _tChar*);
104 using iterator = const_iterator;
105 using const_reverse_iterator = ystdex::reverse_iterator<const_iterator>;
106 using reverse_iterator = const_reverse_iterator;
107 using size_type = size_t;
108 using difference_type = ptrdiff_t;
109 static yconstexpr size_type npos = size_type(-1);
110
111 private:
112 const_pointer data_;
113 size_type size_;
114
115 public:
116 yconstfn
117 basic_string_view() ynothrow
118 : data_(), size_()
119 {}
120 YB_NONNULL(2) yconstfn
121 basic_string_view(const _tChar* str)
122 : data_(str), size_(traits_type::length(str))
123 {}
125 YB_NONNULL(2) yconstfn
126 basic_string_view(const _tChar* str, size_type len) ynothrowv
127 : data_(str), size_(len)
128 {}
129 yconstfn
130 basic_string_view(const basic_string_view&) ynothrow = default;
131
132 yconstfn_relaxed basic_string_view&
133 operator=(const basic_string_view&) ynothrow = default;
134
135 YB_ATTR_nodiscard YB_PURE yconstfn const_iterator
136 begin() const ynothrow
137 {
138 return data_;
139 }
140
141 YB_ATTR_nodiscard YB_PURE yconstfn const_iterator
142 end() const ynothrow
143 {
144 return data_ + size_;
145 }
146
147 YB_ATTR_nodiscard YB_PURE yconstfn const_iterator
148 cbegin() const ynothrow
149 {
150 return data_;
151 }
152
153 YB_ATTR_nodiscard YB_PURE yconstfn const_iterator
154 cend() const ynothrow
155 {
156 return data_ + size_;
157 }
158
159 YB_ATTR_nodiscard YB_PURE yconstfn const_reverse_iterator
160 rbegin() const ynothrow
161 {
162 return const_reverse_iterator(end());
163 }
164
165 YB_ATTR_nodiscard YB_PURE yconstfn const_reverse_iterator
166 rend() const ynothrow
167 {
168 return const_reverse_iterator(begin());
169 }
170
171 YB_ATTR_nodiscard YB_PURE yconstfn const_reverse_iterator
172 crbegin() const ynothrow
173 {
174 return const_reverse_iterator(cend());
175 }
176
177 YB_ATTR_nodiscard YB_PURE yconstfn const_reverse_iterator
178 crend() const ynothrow
179 {
180 return const_reverse_iterator(cbegin());
181 }
182
183 YB_ATTR_nodiscard YB_PURE yconstfn size_type
184 size() const ynothrow
185 {
186 return size_;
187 }
188
189 YB_ATTR_nodiscard YB_PURE yconstfn size_type
190 length() const ynothrow
191 {
192 return size_;
193 }
194
195 YB_ATTR_nodiscard YB_PURE yconstfn size_type
196 max_size() const ynothrow
197 {
198 // NOTE: This is same to libc++ but not libstdc++.
199 return std::numeric_limits<size_type>::max();
200 }
201
202 YB_ATTR_nodiscard YB_PURE yconstfn bool
203 empty() const ynothrow
204 {
205 return size_ == 0;
206 }
207
208 YB_ATTR_nodiscard YB_PURE yconstfn const_reference
209 operator[](size_type pos) const
210 {
211 return yconstraint(pos < size_), data_[pos];
212 }
213
214 yconstfn const_reference
215 at(size_type pos) const
216 {
217 return pos < size_ ? data_[pos]
218 : (throw std::out_of_range("string_view::at"), data_[0]);
219 }
220
221 YB_ATTR_nodiscard YB_PURE yconstfn const_reference
222 front() const
223 {
224 return yconstraint(0 < size_), data_[0];
225 }
226
227 YB_ATTR_nodiscard YB_PURE yconstfn const_reference
228 back() const
229 {
230 return yconstraint(0 < size_), data_[size_ - 1];
231 }
232
233 YB_ATTR_nodiscard YB_PURE yconstfn const_pointer
234 data() const ynothrow
235 {
236 return data_;
237 }
238
239 yconstfn_relaxed void
240 remove_prefix(size_type n) ynothrowv
241 {
242 yconstraint(n <= size_), yunseq(data_ += n, size_ -= n);
243 }
244
245 yconstfn_relaxed void
246 remove_suffix(size_type n) ynothrowv
247 {
248 yconstraint(n <= size_), size_ -= n;
249 }
250
251 yconstfn_relaxed void
252 swap(basic_string_view& s) ynothrow
253 {
254 std::swap(data_, s.data_),
255 std::swap(size_, s.size_);
256 }
257
258 YB_NONNULL(2) size_type
259 copy(_tChar* s, size_type n, size_type pos = 0) const
260 {
261 yconstraint(s);
262 if(pos <= size_)
263 {
264 const auto rlen(std::min<size_type>(n, size_ - pos));
265
266 std::copy_n(data_ + pos, rlen, s);
267 return rlen;
268 }
269 throw std::out_of_range("string_view::copy");
270 }
271
272 YB_ATTR_nodiscard yconstfn basic_string_view
273 substr(size_type pos = 0, size_type n = npos) const
274 {
275 return pos <= size_ ? basic_string_view(data_ + pos,
276 std::min(n, size_type(size_ - pos)))
277 : throw std::out_of_range("string_view::substr");
278 }
279
280 YB_ATTR_nodiscard yconstfn int
281 compare(basic_string_view s) const ynothrow
282 {
283 return compare_remained(s, _tTraits::compare(data(), s.data(),
284 std::min<size_type>(size(), s.size())));
285 }
286 YB_ATTR_nodiscard yconstfn int
287 compare(size_type pos1, size_type n1, basic_string_view s) const
288 {
289 return substr(pos1, n1).compare(s);
290 }
291 YB_ATTR_nodiscard yconstfn int
292 compare(size_type pos1, size_type n1, basic_string_view s, size_type pos2,
293 size_type n2) const
294 {
295 return substr(pos1, n1).compare(s.substr(pos2, n2));
296 }
297 YB_ATTR_nodiscard YB_NONNULL(2) yconstfn int
298 compare(const _tChar* s) const
299 {
300 return compare(basic_string_view(s));
301 }
302 YB_ATTR_nodiscard YB_NONNULL(4) yconstfn int
303 compare(size_type pos1, size_type n1, const _tChar* s) const
304 {
305 return substr(pos1, n1).compare(basic_string_view(s));
306 }
307 YB_ATTR_nodiscard YB_NONNULL(4) yconstfn int
308 compare(size_type pos1, size_type n1, const _tChar* s, size_type n2) const
309 {
310 return substr(pos1, n1).compare(basic_string_view(s, n2));
311 }
312
313 private:
314 YB_ATTR_nodiscard yconstfn int
315 compare_remained(basic_string_view s, int ret) const ynothrow
316 {
317 return ret == 0 ? (size() == s.size() ? 0
318 : (size() < s.size() ? -1 : 1)) : ret;
319 }
320
321 public:
322 #define YB_Impl_StringView_search_fn_head(_n, _attr, _spec, ...) \
323 YB_ATTR_nodiscard YB_PURE yconstfn_relaxed _attr size_type \
324 _n(__VA_ARGS__) const _spec \
325 {
326 #define YB_Impl_StringView_search1(_n, _arg) \
327 YB_Impl_StringView_search_fn_head(_n, , ynothrow, basic_string_view s, \
328 size_type pos = _arg) \
329 return ystdex::str_##_n<value_type, size_type, traits_type, \
330 npos>(data_, size_, s.data_, pos, s.size_); \
331 }
332 #define YB_Impl_StringView_search34(_n, _arg) \
333 YB_Impl_StringView_search_fn_head(_n, YB_NONNULL(2), , const _tChar* s, \
334 size_type pos, size_type n) \
335 return yconstraint(s), _n(basic_string_view(s, n), pos); \
336 } \
337 YB_Impl_StringView_search_fn_head(_n, YB_NONNULL(2), , const _tChar* s, \
338 size_type pos = _arg) \
339 return _n(s, pos, traits_type::length(s)); \
340 }
341 #define YB_Impl_StringView_search_mf(_n, _arg) \
342 YB_Impl_StringView_search1(_n, _arg) \
343 YB_Impl_StringView_search_fn_head(_n, , ynothrow, _tChar c, \
344 size_type pos = _arg) \
345 return ystdex::str_##_n<value_type, size_type, traits_type, \
346 npos>(data_, size_, c, pos); \
347 } \
348 YB_Impl_StringView_search34(_n, _arg)
349 #define YB_Impl_StringView_search_mf2(_n, _arg, _n2) \
350 YB_Impl_StringView_search1(_n, _arg) \
351 YB_Impl_StringView_search_fn_head(_n, , ynothrow, _tChar c, \
352 size_type pos = _arg) \
353 return _n2(c, pos); \
354 } \
355 YB_Impl_StringView_search34(_n, _arg)
356
357 YB_Impl_StringView_search_mf(find, 0)
358
359 YB_Impl_StringView_search_mf(rfind, npos)
360
361 YB_Impl_StringView_search_mf2(find_first_of, 0, find)
362
363 YB_Impl_StringView_search_mf2(find_last_of, npos, rfind)
364
365 YB_Impl_StringView_search_mf(find_first_not_of, 0)
366
367 YB_Impl_StringView_search_mf(find_last_not_of, npos)
368
369 #undef YB_Impl_StringView_search_mf
370 #undef YB_Impl_StringView_search_mf2
371 #undef YB_Impl_StringView_search1
372 #undef YB_Impl_StringView_search34
373 #undef YB_Impl_StringView_search_fn_head
374 };
375
377
378 template<typename _tChar, class _tTraits>
379 YB_ATTR_nodiscard YB_PURE yconstfn bool
380 operator==(basic_string_view<_tChar, _tTraits> x,
381 basic_string_view<_tChar, _tTraits> y) ynothrow
382 {
383 return x.compare(y) == 0;
384 }
385 template<typename _tChar, class _tTraits>
386 YB_ATTR_nodiscard YB_PURE yconstfn bool
387 operator==(basic_string_view<_tChar, _tTraits> x,
388 yimpl(decay_t<basic_string_view<_tChar, _tTraits>>) y) ynothrow
389 {
390 return x.compare(y) == 0;
391 }
393 template<typename _tChar, class _tTraits>
394 YB_ATTR_nodiscard YB_PURE yconstfn bool
395 operator==(yimpl(decay_t<basic_string_view<_tChar, _tTraits>>) x,
396 basic_string_view<_tChar, _tTraits> y) ynothrow
397 {
398 return x.compare(y) == 0;
399 }
400
401 template<typename _tChar, class _tTraits>
402 YB_ATTR_nodiscard YB_PURE yconstfn bool
403 operator<(basic_string_view<_tChar, _tTraits> x,
404 basic_string_view<_tChar, _tTraits> y) ynothrow
405 {
406 return x.compare(y) < 0;
407 }
409 template<typename _tChar, class _tTraits>
410 YB_ATTR_nodiscard YB_PURE yconstfn bool
411 operator<(basic_string_view<_tChar, _tTraits> x,
412 yimpl(decay_t<basic_string_view<_tChar, _tTraits>>) y) ynothrow
413 {
414 return x.compare(y) < 0;
415 }
417 template<typename _tChar, class _tTraits>
418 YB_ATTR_nodiscard YB_PURE yconstfn bool
419 operator<(yimpl(decay_t<basic_string_view<_tChar, _tTraits>>) x,
420 basic_string_view<_tChar, _tTraits> y) ynothrow
421 {
422 return x.compare(y) < 0;
423 }
424
425 template<typename _tChar, class _tTraits>
426 std::basic_ostream<_tChar, _tTraits>&
427 operator<<(std::basic_ostream<_tChar, _tTraits>& os,
428 basic_string_view<_tChar, _tTraits> str)
429 {
430 // XXX: Better implementation?
431 return os << std::basic_string<_tChar, _tTraits>(str.data(), str.size());
432 }
434
435 #endif
436
437 using string_view = basic_string_view<char>;
438 using u16string_view = basic_string_view<char16_t>;
439 using u32string_view = basic_string_view<char32_t>;
440 using wstring_view = basic_string_view<wchar_t>;
441
442 } // inline namespace cpp2017;
443
449 template<class _tString>
450 using string_view_t = basic_string_view<typename _tString::value_type>;
451
452 } // namespace ystdex;
453
454 #if YB_Has_string_view != 1
455 namespace std
456 {
457
463 template<typename _tChar, class _tTraits>
464 struct hash<ystdex::basic_string_view<_tChar, _tTraits>>
465 {
466 YB_ATTR_nodiscard YB_PURE size_t
467 operator()(const ystdex::string_view& k) const yimpl(ynothrow)
468 {
469 return ystdex::hash_range(k.data(), k.data() + k.size());
470 }
471 };
472
473 } // namespace std;
474 #endif
475
476 #endif
477
ystdex::cpp2017::basic_string_view::find
size_type find(basic_string_view s, size_type pos=0) const
Definition: string_view.hpp:357
YB_ATTR_nodiscard
#define YB_ATTR_nodiscard
标记返回值不被忽略的属性。
Definition: ydef.h:715
ystdex::cpp2017::basic_string_view::npos
static size_type npos
Definition: string_view.hpp:109
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
ystdex::cpp2017::swap
void swap(optional< _type > &x, optional< _type > &y)
Definition: optional.h:888
ystdex::cpp2017::basic_string_view::basic_string_view
basic_string_view()
Definition: string_view.hpp:117
ystdex::cpp2017::basic_string_view::end
const_iterator end() const
Definition: string_view.hpp:142
ystdex::cpp2017::basic_string_view::const_reference
const _tChar & const_reference
Definition: string_view.hpp:102
yconstexpr
#define yconstexpr
指定编译时常量表达式。
Definition: ydef.h:1072
YB_PURE
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:919
ystdex::cpp2017::basic_string_view::size_type
size_t size_type
Definition: string_view.hpp:107
cstring.h
ISO C 标准字符串扩展。
ystdex::cpp2017::basic_string_view::length
size_type length() const
Definition: string_view.hpp:190
ystdex::cpp2014::min
const _type & min(const _type &a, const _type &b, _fComp comp=less< _type >())
取较小的元素。
Definition: algorithm.hpp:614
ystdex::cpp2017::basic_string_view
Definition: string_view.hpp:95
ystdex::cpp2017::basic_string_view::find_first_of
size_type find_first_of(basic_string_view s, size_type pos=0) const
Definition: string_view.hpp:361
ystdex::cpp2017::basic_string_view::empty
bool empty() const
Definition: string_view.hpp:203
ystdex::cpp2017::basic_string_view::crend
const_reverse_iterator crend() const
Definition: string_view.hpp:178
ystdex::cpp2017::basic_string_view::front
const_reference front() const
Definition: string_view.hpp:222
ystdex::cpp2017::basic_string_view::difference_type
ptrdiff_t difference_type
Definition: string_view.hpp:108
ystdex::cpp2017::reverse_iterator
Definition: range.hpp:116
YSLib::IO::_tTraits
const string &path const String &path class class _tTraits
Definition: YSLib/Service/FileSystem.h:582
platform::size_t
YB_ATTR_nodiscard YF_API size_t
Definition: FileIO.h:1345
ystdex::cpp2017::basic_string_view::data_
const_pointer data_
Definition: string_view.hpp:112
hash.hpp
散列接口。
ystdex::cpp2014::max
const _type & max(const _type &a, const _type &b, _fComp comp=less< _type >())
取较大的元素。
Definition: algorithm.hpp:635
ystdex::cpp2017::basic_string_view::operator==
bool operator==(basic_string_view< _tChar, _tTraits > x, basic_string_view< _tChar, _tTraits > y)
Definition: string_view.hpp:380
ystdex::cpp2017::basic_string_view::compare
int compare(size_type pos1, size_type n1, basic_string_view s, size_type pos2, size_type n2) const
Definition: string_view.hpp:292
ystdex::cpp2017::basic_string_view::compare
int compare(basic_string_view s) const
Definition: string_view.hpp:281
ystdex::cpp2017::basic_string_view::find_first_not_of
size_type find_first_not_of(basic_string_view s, size_type pos=0) const
Definition: string_view.hpp:365
ystdex::hash_range
size_t hash_range(size_t seed, _tIn first, _tIn last)
重复对范围计算散列。
Definition: hash.hpp:90
yconstfn_relaxed
#define yconstfn_relaxed
指定编译时没有 C++11 限制和隐式成员 const 的常量函数。
Definition: ydef.h:1097
ystdex::cpp2017::basic_string_view::compare_remained
int compare_remained(basic_string_view s, int ret) const
Definition: string_view.hpp:315
ystdex::cpp2017::basic_string_view::operator[]
const_reference operator[](size_type pos) const
Definition: string_view.hpp:209
ystdex::cpp2017::basic_string_view::iterator
const_iterator iterator
Definition: string_view.hpp:104
ystdex::cpp2017::basic_string_view::operator=
basic_string_view & operator=(const basic_string_view &)=default
ystdex::cpp2014::decay_t
typename decay< _type >::type decay_t
Definition: meta.hpp:196
ystdex::cpp2017::basic_string_view::max_size
size_type max_size() const
Definition: string_view.hpp:196
ystdex::cpp2017::basic_string_view::data
const_pointer data() const
Definition: string_view.hpp:234
ystdex::cpp2017::basic_string_view::compare
int compare(size_type pos1, size_type n1, basic_string_view s) const
Definition: string_view.hpp:287
string.h
标准库实现 <string> 修正。
std::hash< ystdex::basic_string_view< _tChar, _tTraits > >::operator()
size_t operator()(const ystdex::string_view &k) const
Definition: string_view.hpp:467
ystdex::cpp2017::basic_string_view::traits_type
_tTraits traits_type
Definition: string_view.hpp:97
ystdex::cpp2017::basic_string_view::crbegin
const_reverse_iterator crbegin() const
Definition: string_view.hpp:172
ystdex::cpp2017::basic_string_view::cbegin
const_iterator cbegin() const
Definition: string_view.hpp:148
ystdex::cpp2017::basic_string_view::substr
basic_string_view substr(size_type pos=0, size_type n=npos) const
Definition: string_view.hpp:273
ystdex::cpp2017::basic_string_view::cend
const_iterator cend() const
Definition: string_view.hpp:154
ystdex::cpp2017::basic_string_view::value_type
_tChar value_type
Definition: string_view.hpp:98
ystdex::cpp2017::operator<
auto operator<(const optional< _type > &x, const optional< _tOther > &y) -> optional_relop_t< decltype(std::declval< _type >()< std::declval< _tOther >())>
Definition: optional.h:719
ystdex::cpp2017::basic_string_view::reference
_tChar & reference
Definition: string_view.hpp:101
ystdex::cpp2017::basic_string_view::back
const_reference back() const
Definition: string_view.hpp:228
ystdex::cpp2017::basic_string_view::const_reverse_iterator
ystdex::reverse_iterator< const_iterator > const_reverse_iterator
Definition: string_view.hpp:105
std
Definition: optional.h:982
operators.hpp
重载操作符。
YB_Impl_StringView_search_mf2
#define YB_Impl_StringView_search_mf2(_n, _arg, _n2)
Definition: string_view.hpp:349
yunseq
#define yunseq
无序列依赖表达式组求值。
Definition: ydef.h:1535
ystdex::cpp2017::basic_string_view::copy
size_type copy(_tChar *s, size_type n, size_type pos=0) const
Definition: string_view.hpp:259
ystdex::cpp2017::basic_string_view::size_
size_type size_
Definition: string_view.hpp:113
ystdex::cpp2017::basic_string_view::rfind
size_type rfind(basic_string_view s, size_type pos=npos) const
Definition: string_view.hpp:359
ystdex::cpp2017::basic_string_view::rbegin
const_reverse_iterator rbegin() const
Definition: string_view.hpp:160
yconstraint
#define yconstraint(_expr)
约束：接口语义。
Definition: cassert.h:125
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
ystdex::cpp2017::basic_string_view::at
const_reference at(size_type pos) const
Definition: string_view.hpp:215
ystdex::cpp2017::basic_string_view::rend
const_reverse_iterator rend() const
Definition: string_view.hpp:166
range.hpp
范围操作。
CHRLib::s
_tDst const _tSrc * s
Definition: CharacterProcessing.h:143
ystdex::cpp2017::basic_string_view::find_last_not_of
size_type find_last_not_of(basic_string_view s, size_type pos=npos) const
Definition: string_view.hpp:367
ystdex::cpp2017::basic_string_view::find_last_of
size_type find_last_of(basic_string_view s, size_type pos=npos) const
Definition: string_view.hpp:363
ystdex::cpp2017::basic_string_view::const_iterator
const _tChar * const_iterator
Definition: string_view.hpp:103
ystdex::cpp2017::basic_string_view::remove_suffix
void remove_suffix(size_type n)
Definition: string_view.hpp:246
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:1219
ystdex
<memory> 特性测试宏。
Definition: ydef.h:1262
ystdex::cpp2017::basic_string_view::pointer
_tChar * pointer
Definition: string_view.hpp:99
ystdex::cpp2017::basic_string_view::size
size_type size() const
Definition: string_view.hpp:184
ystdex::cpp2017::basic_string_view::basic_string_view
basic_string_view(const basic_string_view &)=default
ystdex::cpp2017::operator<<
std::basic_ostream< _tChar, _tTraits > & operator<<(std::basic_ostream< _tChar, _tTraits > &os, basic_string_view< _tChar, _tTraits > str)
Definition: string_view.hpp:427
ystdex::cpp2017::operator==
bool operator==(const optional< _type > &x, nullopt_t)
Definition: optional.h:761
YSLib::Text::str
YB_ATTR_nodiscard YB_PURE const char const char * str
Definition: TextFile.h:83
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
ystdex::cpp2017::basic_string_view::const_pointer
const _tChar * const_pointer
Definition: string_view.hpp:100
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:413
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
ystdex::cpp2017::basic_string_view::begin
const_iterator begin() const
Definition: string_view.hpp:136
ystdex::cpp2017::basic_string_view::remove_prefix
void remove_prefix(size_type n)
Definition: string_view.hpp:240
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:1073
YB_Impl_StringView_search_mf
#define YB_Impl_StringView_search_mf(_n, _arg)
Definition: string_view.hpp:341
ystdex::cpp2017::basic_string_view::swap
void swap(basic_string_view &s)
Definition: string_view.hpp:252