YSTest: pointer.hpp 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

pointer.hpp
浏览该文件的文档.
1 /*
2 © 2012-2019 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
30 #ifndef YB_INC_ystdex_pointer_hpp_
31 #define YB_INC_ystdex_pointer_hpp_ 1
32
33 #include "iterator_op.hpp" // for "iterator_op.hpp", <memory>, pointer_traits,
34 // nullptr_t, bool_, not_, is_function, true_, detected_or_t,
35 // totally_ordered, equality_comparable, add_pointer_t, add_lvalue_reference_t,
36 // yconstraint, iterator_operators_t, std::iterator_traits;
37 #include "functor.hpp" // for indirect_t, std::equal_to, std::less, std::hash,
38 // add_ptr_t, add_ref_t, ystdex::swap_dependent;
39
40 namespace ystdex
41 {
42
44 namespace details
45 {
46
48
49 template<class _tPointer>
50 YB_ATTR_nodiscard inline auto
51 to_address(nullptr_t, const _tPointer& p)
52 -> decltype(std::pointer_traits<_tPointer>::to_address(p))
53 {
54 return std::pointer_traits<_tPointer>::to_address(p);
55 }
56 template<class _tPointer>
57 YB_ATTR_nodiscard inline auto
58 to_address(void*, const _tPointer& p)
59 -> decltype(details::to_address(nullptr, p.operator->()))
60 {
61 return details::to_address(nullptr, p.operator->());
62 }
64
65 template<typename _type>
66 using nptr_eq1 = bool_<_type() == _type()>;
67 template<typename _type>
68 using nptr_eq2 = bool_<_type(nullptr) == nullptr>;
69
71 template<typename _type>
72 struct nptr_eq_checks
73 {
75 static_assert(detected_or_t<true_, details::nptr_eq1, _type>(),
76 "Invalid type found.");
78 static_assert(detected_or_t<true_, details::nptr_eq2, _type>(),
79 "Invalid type found.");
80
81 using reference = indirect_t<_type>;
82 };
83
84 } // namespace details;
85
86
94 template<class _tPointer>
95 YB_ATTR_nodiscard inline auto
96 to_address(const _tPointer& p) ynothrow
97 -> yimpl(decltype(details::to_address(p)))
98 {
99 return details::to_address(nullptr, p);
100 }
101 template<typename _type>
102 YB_ATTR_nodiscard YB_STATELESS yconstfn _type*
103 to_address(_type* p) ynothrow
104 {
105 static_assert(not_<is_function<_type>>(), "Invalid type found.");
106
107 return p;
108 }
110
111
113
114
120 template<typename _type>
121 class nptr : private totally_ordered<nptr<_type>>
122 {
124 static_assert(is_nothrow_copyable<_type>(), "Invalid type found.");
125 static_assert(is_destructible<_type>(), "Invalid type found.");
126
127 public:
128 using pointer = _type;
129
130 private:
131 pointer ptr{};
132
133 public:
134 nptr() = default;
136
137 yconstfn
138 nptr(std::nullptr_t) ynothrow
139 : nptr()
140 {}
141 nptr(pointer p) ynothrow
142 : ptr(p)
143 {}
145 nptr(const nptr&) = default;
146 nptr(nptr&& np) ynothrow
147 {
148 np.swap(*this);
149 }
150
151 nptr&
152 operator=(const nptr&) = default;
153 nptr&
154 operator=(nptr&& np) ynothrow
155 {
156 np.swap(*this);
157 return *this;
158 }
159
160 YB_ATTR_nodiscard YB_PURE yconstfn bool
161 operator!() const ynothrow
162 {
163 return !bool(*this);
164 }
165
171
173 template<yimpl(typename _tPtr = pointer)>
174 YB_ATTR_nodiscard YB_PURE yconstfn_relaxed auto
175 operator*() ynothrow
176 -> yimpl(typename details::nptr_eq_checks<_tPtr>::reference)
177 {
178 return *ptr;
179 }
180 template<yimpl(typename _tPtr = const pointer)>
181 YB_ATTR_nodiscard YB_PURE yconstfn auto
182 operator*() const ynothrow
183 -> yimpl(typename details::nptr_eq_checks<_tPtr>::reference)
184 {
185 return *ptr;
186 }
188
189 YB_ATTR_nodiscard YB_PURE yconstfn_relaxed pointer&
190 operator->() ynothrow
191 {
192 return ptr;
193 }
194 YB_ATTR_nodiscard YB_PURE yconstfn const pointer&
195 operator->() const ynothrow
196 {
197 return ptr;
198 }
200
202 YB_ATTR_nodiscard YB_PURE friend yconstfn bool
203 operator==(const nptr& x, const nptr& y) ynothrow
204 {
205 return std::equal_to<pointer>()(x.ptr, y.ptr);
206 }
207
209 YB_ATTR_nodiscard YB_PURE friend yconstfn bool
210 operator<(const nptr& x, const nptr& y) ynothrow
211 {
212 return std::less<pointer>()(x.ptr, y.ptr);
213 }
214
216 YB_ATTR_nodiscard YB_PURE explicit yconstfn
217 operator bool() const ynothrow
218 {
219 return bool(ptr);
220 }
221
223 YB_ATTR_nodiscard YB_PURE yconstfn const pointer&
224 get() const ynothrow
225 {
226 return ptr;
227 }
228
229 YB_ATTR_nodiscard YB_PURE yconstfn_relaxed pointer&
230 get_ref() ynothrow
231 {
232 return ptr;
233 }
234
239 void
240 swap(nptr& np) ynothrow
241 {
242 ystdex::swap_dependent(ptr, np.ptr);
243 }
244 };
245
250 template<typename _type>
251 inline void
252 swap(nptr<_type>& x, nptr<_type>& y) ynothrow
253 {
254 x.swap(y);
255 }
257
258
260
261
266 template<typename _type>
267 class observer_ptr : private totally_ordered<observer_ptr<_type>>,
268 private equality_comparable<observer_ptr<_type>, nullptr_t>
269 {
270 public:
271 using element_type = _type;
272 using pointer = add_pointer_t<_type>;
273 using reference = add_lvalue_reference_t<_type>;
274
275 private:
276 _type* ptr{};
277
278 public:
280
281 yconstfn
282 observer_ptr() ynothrow yimpl(= default);
283 yconstfn
284 observer_ptr(nullptr_t) ynothrow
285 : ptr()
286 {}
288 explicit yconstfn
289 observer_ptr(pointer p) ynothrow
290 : ptr(p)
291 {}
293 template<typename _tOther,
294 yimpl(typename = enable_if_convertible_t<_tOther*, _type*>)>
295 yconstfn
296 observer_ptr(observer_ptr<_tOther> other) ynothrow
297 : ptr(other.get())
298 {}
299
301 YB_ATTR_nodiscard YB_PURE yconstfn_relaxed reference
302 operator*() const ynothrowv
303 {
304 return yconstraint(get() != nullptr), *ptr;
305 }
306
307 YB_ATTR_nodiscard YB_PURE yconstfn pointer
308 operator->() const ynothrow
309 {
310 return ptr;
311 }
312
314 YB_ATTR_nodiscard YB_PURE friend yconstfn bool
315 operator==(observer_ptr p, nullptr_t) ynothrow
316 {
317 return !p.ptr;
318 }
319
320 YB_ATTR_nodiscard YB_PURE explicit yconstfn
321 operator bool() const ynothrow
322 {
323 return ptr;
324 }
325
326 YB_ATTR_nodiscard YB_PURE explicit yconstfn
327 operator pointer() const ynothrow
328 {
329 return ptr;
330 }
331
332 YB_ATTR_nodiscard YB_PURE yconstfn pointer
333 get() const ynothrow
334 {
335 return ptr;
336 }
337
343 friend yconstfn YB_PURE bool
344 is_undereferenceable(const observer_ptr& p) ynothrow
345 {
346 return !p;
347 }
348
349 yconstfn_relaxed pointer
350 release() ynothrow
351 {
352 const auto res(ptr);
353
354 reset();
355 return res;
356 }
357
358 yconstfn_relaxed void
359 reset(pointer p = {}) ynothrow
360 {
361 ptr = p;
362 }
363
364 yconstfn_relaxed void
365 swap(observer_ptr& other) ynothrow
366 {
367 std::swap(ptr, other.ptr);
368 }
369 };
370
372
373
375 template<typename _type1, typename _type2>
376 YB_ATTR_nodiscard YB_PURE yconstfn bool
377 operator==(observer_ptr<_type1> p1, observer_ptr<_type2> p2) ynothrowv
378 {
379 return p1.get() == p2.get();
380 }
381
382 template<typename _type1, typename _type2>
383 YB_ATTR_nodiscard YB_PURE yconstfn bool
384 operator!=(observer_ptr<_type1> p1, observer_ptr<_type2> p2) ynothrowv
385 {
386 return !(p1 == p2);
387 }
388
389 template<typename _type1, typename _type2>
390 YB_ATTR_nodiscard YB_PURE yconstfn bool
391 operator<(observer_ptr<_type1> p1, observer_ptr<_type2> p2) ynothrowv
392 {
393 return std::less<common_type_t<_type1*, _type2*>>()(p1.get(), p2.get());
394 }
396
397 template<typename _type>
398 inline void
399 swap(observer_ptr<_type>& p1, observer_ptr<_type>& p2) ynothrow
400 {
401 p1.swap(p2);
402 }
403 template<typename _type>
404 YB_ATTR_nodiscard YB_PURE inline observer_ptr<_type>
405 make_observer(_type* p) ynothrow
406 {
407 return observer_ptr<_type>(p);
408 }
410
411
412
414 template<typename _type>
415 using tidy_ptr = nptr<observer_ptr<_type>>;
416
417
428 template<typename _type>
429 class pointer_iterator : public iterator_operators_t<pointer_iterator<_type>,
430 std::iterator_traits<_type*>>
431 {
432 public:
433 using iterator_type = _type*;
434 using iterator_category
435 = typename std::iterator_traits<iterator_type>::iterator_category;
436 using value_type = typename std::iterator_traits<iterator_type>::value_type;
437 using difference_type
438 = typename std::iterator_traits<iterator_type>::difference_type;
439 using pointer = typename std::iterator_traits<iterator_type>::pointer;
440 using reference = typename std::iterator_traits<iterator_type>::reference;
441
442 protected:
444 pointer raw;
445
446 public:
447 yconstfn
448 pointer_iterator(nullptr_t = {})
449 : raw()
450 {}
452 template<typename _tPointer>
453 yconstfn
454 pointer_iterator(_tPointer&& ptr)
455 : raw(yforward(ptr))
456 {}
457 inline
458 pointer_iterator(const pointer_iterator&) = default;
459
461
462 yconstfn_relaxed pointer_iterator&
463 operator+=(difference_type n) ynothrowv
464 {
465 yconstraint(raw);
466 raw += n;
467 return *this;
468 }
469
470 yconstfn_relaxed pointer_iterator&
471 operator-=(difference_type n) ynothrowv
472 {
473 yconstraint(raw);
474 raw -= n;
475 return *this;
476 }
477
479 YB_ATTR_nodiscard YB_PURE yconstfn reference
480 operator*() const ynothrowv
481 {
482 return yconstraint(raw), *raw;
483 }
484
485 yconstfn_relaxed pointer_iterator&
486 operator++() ynothrowv
487 {
488 yconstraint(raw);
489 ++raw;
490 return *this;
491 }
492
493 yconstfn_relaxed pointer_iterator&
494 operator--() ynothrowv
495 {
496 --raw;
497 return *this;
498 }
499
501 YB_ATTR_nodiscard YB_PURE friend yconstfn bool
502 operator==(const pointer_iterator& x, const pointer_iterator& y) ynothrow
503 {
504 return x.raw == y.raw;
505 }
506
508 YB_ATTR_nodiscard YB_PURE friend yconstfn bool
509 operator<(const pointer_iterator& x, const pointer_iterator& y) ynothrow
510 {
511 return x.raw < y.raw;
512 }
513
514 YB_ATTR_nodiscard YB_PURE yconstfn
515 operator pointer() const ynothrow
516 {
517 return raw;
518 }
520 };
521
522
531 template<typename _type>
532 struct pointer_classify
533 {
534 using type = _type;
535 };
536
537 template<typename _type>
538 struct pointer_classify<_type*>
539 {
540 using type = pointer_iterator<_type>;
541 };
543
544 } // namespace ystdex;
545
546 namespace std
547 {
548
553 template<typename _type>
554 struct hash<ystdex::nptr<_type>>
555 {
556 YB_ATTR_nodiscard YB_PURE size_t
557 operator()(const ystdex::observer_ptr<_type>& p) const
558 ynoexcept_spec(hash<_type>(p.get()))
559 {
560 return hash<_type>(p.get());
561 }
562 };
563
569 template<typename _type>
570 struct hash<ystdex::observer_ptr<_type>>
571 {
572 YB_ATTR_nodiscard YB_PURE size_t
573 operator()(const ystdex::observer_ptr<_type>& p) const yimpl(ynothrow)
574 {
575 return hash<_type*>(p.get());
576 }
577 };
578
579 } // namespace std;
580
581 #endif
582
ystdex::to_address
auto to_address(const _tPointer &p) -> decltype(details::to_address(p))
转换指针。
Definition: pointer.hpp:96
ystdex::observer_ptr::element_type
_type element_type
Definition: pointer.hpp:271
ystdex::pointer_iterator::pointer_iterator
pointer_iterator(nullptr_t={})
Definition: pointer.hpp:448
YB_ATTR_nodiscard
#define YB_ATTR_nodiscard
标记返回值不被忽略的属性。
Definition: ydef.h:715
ystdex::details::nptr_eq2
bool_< _type(nullptr)==nullptr > nptr_eq2
Definition: pointer.hpp:68
ystdex::nptr::operator=
nptr & operator=(nptr &&np)
Definition: pointer.hpp:154
ystdex::pointer_classify
指针包装为类类型迭代器。
Definition: pointer.hpp:533
x
const EncapsulationBase & x
Definition: NPLA1Forms.cpp:1536
ystdex::to_address
_type * to_address(_type *p)
Definition: pointer.hpp:103
ystdex::cpp2017::swap
void swap(optional< _type > &x, optional< _type > &y)
Definition: optional.h:888
ystdex::nptr::nptr
nptr(std::nullptr_t)
Definition: pointer.hpp:138
ystdex::cpp2014::add_pointer_t
typename add_pointer< _type >::type add_pointer_t
Definition: meta.hpp:182
YB_PURE
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:919
ystdex::details::to_address
auto to_address(nullptr_t, const _tPointer &p) -> decltype(std::pointer_traits< _tPointer >::to_address(p))
Definition: pointer.hpp:51
ystdex::detected_or_t
_t< detected_or< _tDefault, _gOp, _tParams... > > detected_or_t
Definition: meta.hpp:407
ystdex::swap
void swap(observer_ptr< _type > &p1, observer_ptr< _type > &p2)
Definition: pointer.hpp:399
ystdex::observer_ptr::is_undereferenceable
friend bool is_undereferenceable(const observer_ptr &p)
Definition: pointer.hpp:344
ystdex::nptr
可空指针包装：满足 NullablePointer 要求同时满足转移后为空。
Definition: pointer.hpp:122
ystdex::nptr::operator->
pointer & operator->()
Definition: pointer.hpp:190
ystdex::pointer_iterator::pointer_iterator
pointer_iterator(const pointer_iterator &)=default
ystdex::nptr::nptr
nptr()=default
ystdex::nptr::operator*
auto operator*() const -> typename details::nptr_eq_checks< _tPtr >::reference
Definition: pointer.hpp:182
ystdex::details::nptr_eq_checks::reference
indirect_t< _type > reference
Definition: pointer.hpp:81
ystdex::dep_ops::equality_comparable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, index_sequence< 7 >, index_sequence< 6, 7, 8 > >> > equality_comparable
Definition: operators.hpp:265
ystdex::nptr::operator==
friend bool operator==(const nptr &x, const nptr &y)
Definition: pointer.hpp:203
ystdex::observer_ptr::observer_ptr
observer_ptr(observer_ptr< _tOther > other)
Definition: pointer.hpp:296
ystdex::pointer_classify::type
_type type
Definition: pointer.hpp:534
ystdex::pointer_iterator::reference
typename std::iterator_traits< iterator_type >::reference reference
Definition: pointer.hpp:440
ynoexcept_spec
#define ynoexcept_spec(...)
表达式 noexcept 异常规范。
Definition: ydef.h:1181
ystdex::nullptr_t
空指针类。
Definition: ydef.h:1321
ystdex::observer_ptr::observer_ptr
observer_ptr(pointer p)
Definition: pointer.hpp:289
std::hash< ystdex::nptr< _type > >::operator()
size_t operator()(const ystdex::observer_ptr< _type > &p) const
Definition: pointer.hpp:557
ystdex::nptr::get_ref
pointer & get_ref()
Definition: pointer.hpp:230
ystdex::nptr::nptr
nptr(pointer p)
Definition: pointer.hpp:141
ystdex::pointer_iterator::raw
pointer raw
Definition: pointer.hpp:444
ystdex::observer_ptr::operator==
bool operator==(observer_ptr< _type1 > p1, observer_ptr< _type2 > p2)
Definition: pointer.hpp:377
ystdex::pointer_iterator::iterator_type
_type * iterator_type
Definition: pointer.hpp:433
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:710
YSLib::Drawing::p2
The boundary is out of the const Graphics const Rect const Point const Point & p2
Definition: YDraw.h:162
ystdex::pointer_iterator::operator<
friend bool operator<(const pointer_iterator &x, const pointer_iterator &y)
Definition: pointer.hpp:509
ystdex::indirect_t
decltype(*std::declval< _type >()) indirect_t
Definition: type_traits.hpp:69
yconstfn_relaxed
#define yconstfn_relaxed
指定编译时没有 C++11 限制和隐式成员 const 的常量函数。
Definition: ydef.h:1097
ystdex::nptr::swap
void swap(nptr &np)
Definition: pointer.hpp:240
ystdex::swap_dependent
void swap_dependent(_type &x, _type &y)(is_nothrow_swappable< _type >())
支持基于 ystdex_swap::swap 的 ADL 的左值交换。
Definition: swap.hpp:371
ystdex::nptr::nptr
nptr(nptr &&np)
Definition: pointer.hpp:146
ystdex::pointer_iterator::operator-=
pointer_iterator & operator-=(difference_type n)
Definition: pointer.hpp:471
ystdex::is_nothrow_copyable
Definition: meta.hpp:628
ystdex::nptr::nptr
nptr(const nptr &)=default
ystdex::nptr::operator!
bool operator!() const
Definition: pointer.hpp:161
ystdex::bool_
integral_constant< bool, _vInt > bool_
Definition: integral_constant.hpp:93
ystdex::pointer_iterator::operator*
reference operator*() const
Definition: pointer.hpp:480
ystdex::pointer_iterator::operator==
friend bool operator==(const pointer_iterator &x, const pointer_iterator &y)
Definition: pointer.hpp:502
ystdex::nptr< link_type >::pointer
link_type pointer
Definition: pointer.hpp:128
ystdex::observer_ptr::ptr
_type * ptr
Definition: pointer.hpp:276
ystdex::observer_ptr::swap
void swap(observer_ptr &other)
Definition: pointer.hpp:365
CHRLib::CharSet::other
@ other
Definition: Encoding.h:65
ystdex::observer_ptr::operator->
pointer operator->() const
Definition: pointer.hpp:308
YSLib::Drawing::p1
The boundary is out of the const Graphics const Rect const Point & p1
Definition: YDraw.h:162
ystdex::make_observer
observer_ptr< _type > make_observer(_type *p)
Definition: pointer.hpp:405
ystdex::pointer_iterator
指针迭代器。
Definition: pointer.hpp:431
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 转发对应参数。
Definition: ydef.h:1508
ystdex::nptr::swap
void swap(nptr< _type > &x, nptr< _type > &y)
Definition: pointer.hpp:252
ystdex::observer_ptr::release
pointer release()
Definition: pointer.hpp:350
ystdex::observer_ptr::operator*
reference operator*() const
Definition: pointer.hpp:302
ystdex::nptr::get
const pointer & get() const
Definition: pointer.hpp:224
ystdex::pointer_iterator::pointer_iterator
pointer_iterator(_tPointer &&ptr)
Definition: pointer.hpp:454
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
YB_STATELESS
#define YB_STATELESS
指示函数或函数模板实例为无状态函数。
Definition: ydef.h:941
ystdex::observer_ptr::operator==
friend bool operator==(observer_ptr p, nullptr_t)
Definition: pointer.hpp:315
std
Definition: optional.h:982
ystdex::observer_ptr::reset
void reset(pointer p={})
Definition: pointer.hpp:359
ystdex::nptr::operator*
auto operator*() -> typename details::nptr_eq_checks< _tPtr >::reference
Definition: pointer.hpp:175
ystdex::details::nptr_eq_checks
Definition: pointer.hpp:73
ystdex::cpp2014::add_lvalue_reference_t
typename add_lvalue_reference< _type >::type add_lvalue_reference_t
Definition: meta.hpp:158
ystdex::dep_ops::totally_ordered
details::flat_ops< _type, _type2, _tOpt, less_than_comparable, equality_comparable > totally_ordered
Definition: operators.hpp:389
ystdex::nptr::operator=
nptr & operator=(const nptr &)=default
ystdex::iterator_operators_t
_t< details::iterator_operators< _tIter, _tTraits > > iterator_operators_t
按迭代器类别取可实现迭代器的重载操作符集合的实现。
Definition: iterator_op.hpp:211
yconstraint
#define yconstraint(_expr)
约束：接口语义。
Definition: cassert.h:125
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
ystdex::observer_ptr::observer_ptr
observer_ptr()=default
ystdex::pointer_iterator::operator+=
pointer_iterator & operator+=(difference_type n)
Definition: pointer.hpp:463
iterator_op.hpp
迭代器操作。
ystdex::pointer_iterator::value_type
typename std::iterator_traits< iterator_type >::value_type value_type
Definition: pointer.hpp:436
ystdex::pointer_iterator::difference_type
typename std::iterator_traits< iterator_type >::difference_type difference_type
Definition: pointer.hpp:438
ystdex::enable_if_convertible_t
enable_if_t< is_convertible< _tFrom, _tTo >::value, _type > enable_if_convertible_t
Definition: meta.hpp:837
ystdex::nptr::operator->
const pointer & operator->() const
Definition: pointer.hpp:195
std::hash< ystdex::observer_ptr< _type > >::operator()
size_t operator()(const ystdex::observer_ptr< _type > &p) const
Definition: pointer.hpp:573
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:1219
ystdex
<memory> 特性测试宏。
Definition: ydef.h:1262
ystdex::observer_ptr::get
pointer get() const
Definition: pointer.hpp:333
ystdex::pointer_iterator::iterator_category
typename std::iterator_traits< iterator_type >::iterator_category iterator_category
Definition: pointer.hpp:435
platform::p
return p p
Definition: YCLib/FileSystem.h:209
ystdex::pointer_iterator::operator++
pointer_iterator & operator++()
Definition: pointer.hpp:486
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:413
platform::bool
YB_ATTR_nodiscard std::FILE *fp bool
Definition: FileIO.h:1271
ystdex::nptr::ptr
pointer ptr
Definition: pointer.hpp:131
ystdex::not_
逻辑非。
Definition: integral_constant.hpp:193
ystdex::details::nptr_eq1
bool_< _type()==_type()> nptr_eq1
Definition: pointer.hpp:66
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
functor.hpp
通用仿函数。
ystdex::pointer_iterator::operator--
pointer_iterator & operator--()
Definition: pointer.hpp:494
ystdex::pointer_iterator::pointer
typename std::iterator_traits< iterator_type >::pointer pointer
Definition: pointer.hpp:439
ystdex::observer_ptr
观察者指针：无所有权的智能指针。
Definition: pointer.hpp:269
ystdex::observer_ptr::pointer
add_pointer_t< _type > pointer
Definition: pointer.hpp:272
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:1073
ystdex::nptr::operator<
friend bool operator<(const nptr &x, const nptr &y)
Definition: pointer.hpp:210
ystdex::observer_ptr::reference
add_lvalue_reference_t< _type > reference
Definition: pointer.hpp:273