diff --git a/include/libtorrent/bitfield.hpp b/include/libtorrent/bitfield.hpp index d4b42fca4..808107c1d 100644 --- a/include/libtorrent/bitfield.hpp +++ b/include/libtorrent/bitfield.hpp @@ -63,6 +63,11 @@ namespace libtorrent bitfield(bitfield const& rhs): m_bytes(0), m_size(0), m_own(false) { assign(rhs.bytes(), rhs.size()); } +#if __cplusplus > 199711L + bitfield(bitfield&& rhs): m_bytes(rhs.m_bytes), m_size(rhs.m_size), m_own(rhs.m_own) + { rhs.m_bytes = NULL; } +#endif + // assigns a bitfield pointed to ``b`` of ``bits`` number of bits, without // taking ownership of the buffer. This is a way to avoid copying data and // yet provide a raw buffer to functions that may operate on the bitfield diff --git a/include/libtorrent/buffer.hpp b/include/libtorrent/buffer.hpp index fa433094e..40d4a1fde 100644 --- a/include/libtorrent/buffer.hpp +++ b/include/libtorrent/buffer.hpp @@ -114,6 +114,11 @@ public: std::memcpy(m_begin, b.begin(), b.size()); } +#if __cplusplus > 199711L + buffer(buffer&& b): m_begin(b.m_begin), m_end(b.m_end), m_last(b.m_last) + { b.m_begin = b.m_end = b.m_last = NULL; } +#endif + buffer& operator=(buffer const& b) { if (&b == this) return *this;