add move operators for VclPtr
Change-Id: Ic32894d13aac2d8038afec2efebcc544f1c408af Reviewed-on: https://gerrit.libreoffice.org/30748 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -101,6 +101,13 @@ public:
|
||||
: m_rInnerRef (handle.m_rInnerRef)
|
||||
{}
|
||||
|
||||
/** Move constructor...
|
||||
*/
|
||||
inline VclPtr (VclPtr<reference_type> && handle)
|
||||
: m_rInnerRef ( std::move(handle.m_rInnerRef) )
|
||||
{
|
||||
}
|
||||
|
||||
/** Up-casting conversion constructor: Copies interface reference.
|
||||
|
||||
Does not work for up-casts to ambiguous bases. For the special case of
|
||||
@@ -157,7 +164,7 @@ public:
|
||||
m_rInnerRef.set(pBody);
|
||||
}
|
||||
|
||||
/** Up-casting assignment operator.
|
||||
/** Up-casting copy assignment operator.
|
||||
|
||||
Does not work for up-casts to ambiguous bases.
|
||||
|
||||
@@ -173,6 +180,22 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** move assignment operator.
|
||||
*/
|
||||
VclPtr & operator =(VclPtr<reference_type> && rRef)
|
||||
{
|
||||
m_rInnerRef = std::move(rRef);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** copy assignment operator.
|
||||
*/
|
||||
VclPtr & operator =(const VclPtr<reference_type> & rRef)
|
||||
{
|
||||
m_rInnerRef = rRef;
|
||||
return *this;
|
||||
}
|
||||
|
||||
VclPtr & operator =(reference_type * pBody)
|
||||
{
|
||||
m_rInnerRef.set(pBody);
|
||||
|
Reference in New Issue
Block a user