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);
|
||||
}
|
||||
};
|
||||
|
||||
Protected<JSValueRef>& operator=(Protected<JSValueRef> other) {
|
||||
std::swap(m_context, other.m_context);
|
||||
std::swap(m_value, other.m_value);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
|
@ -104,6 +110,11 @@ class Protected<JSObjectRef> : public Protected<JSValueRef> {
|
|||
JSValueRef value = static_cast<JSValueRef>(*this);
|
||||
return (JSObjectRef)value;
|
||||
}
|
||||
|
||||
Protected<JSObjectRef>& operator=(Protected<JSObjectRef> other) {
|
||||
std::swap(*this, other);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
} // js
|
||||
|
|
Loading…
Reference in New Issue