diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-09-23 18:33:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-23 18:33:48 +0200 |
commit | 09a77ceaf64852fa3204c2d9221a293bb3820dae (patch) | |
tree | 13d4c5146bbddd4dcdb60914d9b2d75b4261afee /include/uno | |
parent | c53af84c9ca1a1d5090d72b03a8c483d7485f7db (diff) |
cid#1371232: Add move semantics
Change-Id: I8bd9a62da64adfc52be9ba954eb8dbc92d8ecc77
Diffstat (limited to 'include/uno')
-rw-r--r-- | include/uno/mapping.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/uno/mapping.hxx b/include/uno/mapping.hxx index 6db166e25ddc..7ec6a11e54a5 100644 --- a/include/uno/mapping.hxx +++ b/include/uno/mapping.hxx @@ -110,6 +110,11 @@ public: */ inline Mapping( const Mapping & rMapping ); +#if defined LIBO_INTERNAL_ONLY + Mapping(Mapping && other): _pMapping(other._pMapping) + { other._pMapping = nullptr; } +#endif + /** Destructor. */ inline ~Mapping(); @@ -128,6 +133,17 @@ public: inline Mapping & SAL_CALL operator = ( const Mapping & rMapping ) { return operator = ( rMapping._pMapping ); } +#if defined LIBO_INTERNAL_ONLY + Mapping & operator =(Mapping && other) { + if (_pMapping != nullptr) { + (*_pMapping->release)(_pMapping); + } + _pMapping = other._pMapping; + other._pMapping = nullptr; + return *this; + } +#endif + /** Provides a pointer to the C mapping. The returned mapping is NOT acquired! @return UNacquired C mapping |