summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-25 15:13:34 +0200
committerNoel Grandin <noel@peralex.com>2016-08-29 09:23:46 +0200
commit74fbfde33205e0af1c44fbbe47963c827c7efedc (patch)
treec352a09619a520eca826a70cfff229afbda15bd6
parent4e07987ce8134312920682e3481c3f8e3d7b66c3 (diff)
cid#1371173 Missing move assignment operator
Change-Id: Idf179403426d9714fa73d0c3370a6debc30a0431
-rw-r--r--include/tools/weakbase.h8
-rw-r--r--include/tools/weakbase.hxx14
2 files changed, 21 insertions, 1 deletions
diff --git a/include/tools/weakbase.h b/include/tools/weakbase.h
index aba255ee92b1..f8c74283e3ad 100644
--- a/include/tools/weakbase.h
+++ b/include/tools/weakbase.h
@@ -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;
};
diff --git a/include/tools/weakbase.hxx b/include/tools/weakbase.hxx
index bdbcded5b61a..7b693cc73efc 100644
--- a/include/tools/weakbase.hxx
+++ b/include/tools/weakbase.hxx
@@ -49,6 +49,12 @@ inline WeakReference< reference_type >::WeakReference( const WeakReference< refe
}
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()
{
}
@@ -123,6 +129,14 @@ inline WeakReference<reference_type>& WeakReference<reference_type>::operator= (
}
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()
{
}