28 #ifndef YSL_INC_Adaptor_yref_hpp_
29 #define YSL_INC_Adaptor_yref_hpp_ 1
32 #include YFM_YSLib_Adaptor_YAdaptor
39 using std::bad_weak_ptr;
40 using std::const_pointer_cast;
41 using std::dynamic_pointer_cast;
42 using std::enable_shared_from_this;
43 using std::get_deleter;
51 using std::owner_less;
54 using std::shared_ptr;
55 using std::static_pointer_cast;
57 using std::unique_ptr;
67 template<
typename _type>
83 template<
typename _type>
94 template<
typename _type1,
typename _type2>
96 operator==(
const weak_ptr<_type1>& x,
const weak_ptr<_type2>& y)
98 return !x.owner_before(y) && !y.owner_before(x);
105 template<
typename _type>
109 return sp.get() != p;
116 template<
typename _type1,
typename _type2>
118 operator!=(
const weak_ptr<_type1>& x,
const weak_ptr<_type2>& y)
bool operator==(const shared_ptr< _type > &sp, _type *p)
比较: shared_ptr 和内建指针类型的相等关系。
std::unique_ptr< _type > unique_raw(const _pSrc &p)
std::shared_ptr< _type > make_shared(_tParams &&...args)
使用 new 和指定参数构造指定类型的 std::shared_ptr 实例。
std::shared_ptr< _type > share_raw(const _pSrc &p)
_type * get_raw(_type *const &p)
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
bool reset(std::unique_ptr< _type > &p)
bool operator!=(const shared_ptr< _type > &sp, _type *p)
比较: shared_ptr 左值和内建指针类型的不等关系。
enable_if_t<!is_array< _type >::value, std::unique_ptr< _type > > make_unique(_tParams &&...args)
使用 new 和指定参数构造指定类型的 std::unique_ptr 实例。
bool reset(_type *&p) ynothrow