Kaydet (Commit) c53af84c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

cid#13711966: Add move semantics

Change-Id: I7bf2d6f5e5b1d10cde210c814567017680c6a74e
üst 4c182392
......@@ -94,6 +94,11 @@ public:
*/
inline Environment( const Environment & rEnv );
#if defined LIBO_INTERNAL_ONLY
Environment(Environment && other): _pEnv(other._pEnv)
{ other._pEnv = nullptr; }
#endif
/** Destructor: releases a set environment.
*/
inline ~Environment();
......@@ -112,6 +117,17 @@ public:
inline Environment & SAL_CALL operator = ( const Environment & rEnv )
{ return operator = ( rEnv._pEnv ); }
#if defined LIBO_INTERNAL_ONLY
Environment & operator =(Environment && other) {
if (_pEnv != nullptr) {
(*_pEnv->release)(_pEnv);
}
_pEnv = other._pEnv;
other._pEnv = nullptr;
return *this;
}
#endif
/** Provides UNacquired pointer to the set C environment.
@return UNacquired pointer to the C environment struct
......
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