diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-21 08:34:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-21 08:34:52 +0200 |
commit | c33647429b179c024f0749be85c89f737a8b42db (patch) | |
tree | 5dc1785b7e350f38c1d77ff2dd2c3c014f0c4b8f /include | |
parent | dec8da2a9aadbb6758ee76c30582bd8620a10ecb (diff) |
cid#1371252: Add move semantics
Change-Id: I7cf1b4c92fdddbef681654c780a9ee466c33ce0b
Diffstat (limited to 'include')
-rw-r--r-- | include/typelib/typedescription.hxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/typelib/typedescription.hxx b/include/typelib/typedescription.hxx index c8f0eb24d2de..8ce75bd1691b 100644 --- a/include/typelib/typedescription.hxx +++ b/include/typelib/typedescription.hxx @@ -82,6 +82,10 @@ public: @param rDescr another TypeDescription */ inline TypeDescription( const TypeDescription & rDescr ); +#if defined LIBO_INTERNAL_ONLY + TypeDescription(TypeDescription && other): _pTypeDescr(other._pTypeDescr) + { other._pTypeDescr = nullptr; } +#endif /** Constructor: @param pTypeName a type name @@ -110,6 +114,17 @@ public: inline TypeDescription & SAL_CALL operator =( const TypeDescription & rTypeDescr ) { return this->operator =( rTypeDescr.get() ); } +#if defined LIBO_INTERNAL_ONLY + TypeDescription & operator =(TypeDescription && other) { + if (_pTypeDescr != nullptr) { + typelib_typedescription_release(_pTypeDescr); + } + _pTypeDescr = other._pTypeDescr; + other._pTypeDescr = nullptr; + return *this; + } +#endif + /** Tests whether two type descriptions are equal. @param pTypeDescr another type description |