mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 22:36:01 +00:00
copy assignment operator
This commit is contained in:
parent
f86975f78e
commit
140599968f
@ -90,6 +90,12 @@ class Protected<JSValueRef> {
|
|||||||
return JSValueIsStrictEqual(a.m_context, a.m_value, b.m_value);
|
return JSValueIsStrictEqual(a.m_context, a.m_value, b.m_value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Protected<JSValueRef>& operator=(Protected<JSValueRef> other) {
|
||||||
|
std::swap(m_context, other.m_context);
|
||||||
|
std::swap(m_value, other.m_value);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
@ -104,6 +110,11 @@ class Protected<JSObjectRef> : public Protected<JSValueRef> {
|
|||||||
JSValueRef value = static_cast<JSValueRef>(*this);
|
JSValueRef value = static_cast<JSValueRef>(*this);
|
||||||
return (JSObjectRef)value;
|
return (JSObjectRef)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Protected<JSObjectRef>& operator=(Protected<JSObjectRef> other) {
|
||||||
|
std::swap(*this, other);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // js
|
} // js
|
||||||
|
Loading…
x
Reference in New Issue
Block a user