fix compile error

This commit is contained in:
Emiel Bruijntjes 2015-11-04 13:10:05 +01:00
parent 23fa396683
commit 1370afee94
2 changed files with 21 additions and 1 deletions

View File

@ -73,6 +73,26 @@ public:
that._size = 0;
}
/**
* Move assignment operator
* @param that
*/
TcpBuffer &operator=(TcpBuffer &&that)
{
// skip self-assignment
if (this == &that) return *this;
// swap buffers
_buffers.swap(that._buffers);
// swap integers
std::swap(_skip, that._skip);
std::swap(_size, that._size);
// done
return *this;
}
/**
* Does the buffer exist (is it non-empty)
* @return bool

View File

@ -139,7 +139,7 @@ public:
buffer.shrink(processed);
// restore the buffer as member
_in = std::move(buffer);
std::swap(_in, buffer);
}
}