Commit 0da79f9c authored by Xavier Thompson's avatar Xavier Thompson

Optimise conversion of rvalue cypclass smart pointers to raw cypclass pointers

parent 16bc867e
......@@ -164,13 +164,19 @@
return uobj;
}
operator T*() const {
operator T*() const& {
if (uobj != nullptr) {
uobj->CyObject_INCREF();
}
return uobj;
}
operator T*() && {
T* obj = uobj;
uobj = nullptr;
return obj;
}
template <typename U>
bool operator==(const Cy_Ref_impl<U>& rhs) const noexcept {
return uobj == rhs.uobj;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment