12#define WARN_UNUSED_RESULT(ret, decl) ret decl __attribute__((warn_unused_result))
14#define WARN_UNUSED_RESULT(ret, decl) ret decl
17template <
typename Derived,
typename T>
25 void Reset(T *
p = 0) { Derived(
p).Swap(*
static_cast<Derived *
>(
this)); }
89#define DEF_SMARTPTR_COMPARISON(op) \
90 template <typename D1, typename T1, typename D2, typename T2> \
91 inline bool operator op(const SmartPtrBase<D1, T1> &a, const SmartPtrBase<D2, T2> &b) \
93 return (a.Get() op b.Get()); \
95 template <typename D, typename T1, typename T2> \
96 inline bool operator op(const SmartPtrBase<D, T1> &a, const T2 *b) \
98 return (a.Get() op b); \
100 template <typename D, typename T1, typename T2> \
101 inline bool operator op(const T1 *a, const SmartPtrBase<D, T2> &b) \
103 return (a op b.Get()); \
111#undef DEF_SMARTPTR_COMPARISON
#define WARN_UNUSED_RESULT(ret, decl)
Definition SmartPtr.h:14
#define DEF_SMARTPTR_COMPARISON(op)
Definition SmartPtr.h:89
m_ptr
Definition SmartPtr.h:82
friend bool operator==(const this_type &a, const T *b)
Definition SmartPtr.h:57
bool Valid() const
Definition SmartPtr.h:38
return p
Definition SmartPtr.h:83
friend void swap(this_type &a, this_type &b)
Definition SmartPtr.h:44
SmartPtrBase()
Definition SmartPtr.h:72
friend bool operator==(const T *a, const this_type &b)
Definition SmartPtr.h:64
friend bool operator<(const this_type &a, const T *b)
Definition SmartPtr.h:59
friend bool operator>(const this_type &a, const T *b)
Definition SmartPtr.h:61
friend bool operator<=(const this_type &a, const T *b)
Definition SmartPtr.h:60
friend bool operator>=(const this_type &a, const T *b)
Definition SmartPtr.h:62
SmartPtrBase(T *p)
Definition SmartPtr.h:74
friend bool operator!=(const T *a, const this_type &b)
Definition SmartPtr.h:65
friend bool operator>(const T *a, const this_type &b)
Definition SmartPtr.h:68
bool operator!() const
Definition SmartPtr.h:42
T * Get() const
Definition SmartPtr.h:37
void Reset(T *p=0)
Definition SmartPtr.h:25
friend bool operator<(const T *a, const this_type &b)
Definition SmartPtr.h:66
friend bool operator<=(const T *a, const this_type &b)
Definition SmartPtr.h:67
friend bool operator>=(const T *a, const this_type &b)
Definition SmartPtr.h:69
T * operator->() const
Definition SmartPtr.h:32
T * m_ptr
Definition SmartPtr.h:86
T & operator*() const
Definition SmartPtr.h:27
friend bool operator!=(const this_type &a, const T *b)
Definition SmartPtr.h:58
void Swap(this_type &b)
Definition SmartPtr.h:46
Definition SmartPtr.h:114
void operator()(void *p)
Definition SmartPtr.h:115