Skip to content

Commit

Permalink
add move constructor and assignment operator
Browse files Browse the repository at this point in the history
  • Loading branch information
kdt3rd authored and nickrasmussen committed Aug 8, 2018
1 parent 15ce54c commit cfebcc2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion OpenEXR/IlmImf/ImfDwaCompressorSimd.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,25 @@ class SimdAlignedBuffer64
return *this;
}

#if __cplusplus >= 201103L
SimdAlignedBuffer64(SimdAlignedBuffer64 &&rhs) noexcept
: _handle(rhs._handle), _buffer(rhs._buffer)
{
rhs._handle = nullptr;
rhs._buffer = nullptr;
}

SimdAlignedBuffer64 &operator=(SimdAlignedBuffer64 &&rhs) noexcept
{
std::swap(_handle, rhs._handle);
std::swap(_buffer, rhs._buffer);
return *this;
}
#endif
~SimdAlignedBuffer64 ()
{
EXRFreeAligned (_handle);
if (_handle)
EXRFreeAligned (_handle);
_handle = 0;
_buffer = 0;
}
Expand Down

0 comments on commit cfebcc2

Please sign in to comment.