Commit 0e08b060 authored by Matthieu Dorier's avatar Matthieu Dorier

corrected move constructor

parent add992ec
......@@ -100,12 +100,12 @@ class WriteBatch {
/**
* @brief Deleted copy-assignment operator.
*/
WriteBatch(WriteBatch&&) = default;
WriteBatch(WriteBatch&&);
/**
* @brief Deleted move-assignment operator.
*/
WriteBatch& operator=(WriteBatch&&) = default;
WriteBatch& operator=(WriteBatch&&);
/**
* @brief Flush the content of the WriteBatch, blocking until
......
......@@ -11,6 +11,15 @@ namespace hepnos {
WriteBatch::WriteBatch() {}
WriteBatch::WriteBatch(WriteBatch&& other)
: m_impl(std::move(other.m_impl)) {}
WriteBatch& WriteBatch::operator=(WriteBatch&& other) {
if(&other == this) return *this;
m_impl = std::move(other.m_impl);
return *this;
}
WriteBatch::WriteBatch(DataStore& datastore, unsigned max_batch_size)
: m_impl(std::make_unique<WriteBatchImpl>(datastore.m_impl, max_batch_size)) {}
......
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