Kaydet (Commit) 74fbfde3 authored tarafından Noel Grandin's avatar Noel Grandin

cid#1371173 Missing move assignment operator

Change-Id: Idf179403426d9714fa73d0c3370a6debc30a0431
üst 4e07987c
......@@ -78,9 +78,12 @@ public:
/** constructs a reference with a pointer to a class derived from WeakBase */
inline WeakReference( reference_type* pReference );
/** constructs a reference with another reference */
/** constructs a reference from another reference */
inline WeakReference( const WeakReference< reference_type >& rWeakRef );
/** constructs a reference from another reference */
inline WeakReference( WeakReference< reference_type >&& rWeakRef );
inline ~WeakReference();
/** returns true if the reference object is not null and still alive */
......@@ -113,6 +116,9 @@ public:
/** the assignment operator */
inline WeakReference<reference_type>& operator= (const WeakReference<reference_type> & handle);
/** the move assignment operator */
inline WeakReference<reference_type>& operator= (WeakReference<reference_type> && handle);
private:
rtl::Reference<WeakConnection< reference_type >> mpWeakConnection;
};
......
......@@ -48,6 +48,12 @@ inline WeakReference< reference_type >::WeakReference( const WeakReference< refe
mpWeakConnection = rWeakRef.mpWeakConnection;
}
template< class reference_type >
inline WeakReference< reference_type >::WeakReference( WeakReference< reference_type >&& rWeakRef )
{
mpWeakConnection = std::move(rWeakRef.mpWeakConnection);
}
template< class reference_type >
inline WeakReference< reference_type >::~WeakReference()
{
......@@ -122,6 +128,14 @@ inline WeakReference<reference_type>& WeakReference<reference_type>::operator= (
return *this;
}
template< class reference_type >
inline WeakReference<reference_type>& WeakReference<reference_type>::operator= (
WeakReference<reference_type>&& rReference)
{
mpWeakConnection = std::move(rReference.mpWeakConnection);
return *this;
}
template< class reference_type >
inline WeakBase< reference_type >::WeakBase()
{
......
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