File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ class resptr_base
80
80
T* prhs = rhs._get ();
81
81
_set (prhs);
82
82
}
83
+ ICF void _set (resptr_base<T>&& rhs)
84
+ {
85
+ p_ = rhs.p_ ;
86
+ rhs.p_ = nullptr ;
87
+ }
83
88
ICF T* _get () const { return p_; }
84
89
void _clear () { p_ = 0 ; }
85
90
};
@@ -106,13 +111,23 @@ class resptr_core : public C
106
111
C::p_ = rhs.p_ ;
107
112
C::_inc ();
108
113
}
114
+ resptr_core (self&& rhs) noexcept
115
+ {
116
+ C::p_ = rhs.p_ ;
117
+ rhs.p_ = nullptr ;
118
+ }
109
119
~resptr_core () { C::_dec (); }
110
120
// assignment
111
121
self& operator =(const self& rhs)
112
122
{
113
123
this ->_set (rhs);
114
124
return (self&)*this ;
115
125
}
126
+ self& operator =(self&& rhs) noexcept
127
+ {
128
+ this ->_set (std::move (rhs));
129
+ return (self&)*this ;
130
+ }
116
131
117
132
// accessors
118
133
T& operator *() const { return *C::p_; }
You can’t perform that action at this time.
0 commit comments