diff --git a/include/libtorrent/entry.hpp b/include/libtorrent/entry.hpp index 627d4c67c..2f99859e2 100644 --- a/include/libtorrent/entry.hpp +++ b/include/libtorrent/entry.hpp @@ -136,6 +136,7 @@ namespace libtorrent // hidden entry(entry const& e); + entry(entry&& e); // hidden entry(); @@ -154,6 +155,7 @@ namespace libtorrent #endif entry& operator=(bdecode_node const&); entry& operator=(entry const&); + entry& operator=(entry&&); entry& operator=(dictionary_type const&); entry& operator=(string_type const&); entry& operator=(list_type const&); diff --git a/src/entry.cpp b/src/entry.cpp index 3cd98675f..a46bc986c 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -163,6 +163,12 @@ namespace libtorrent return *this; } + entry& entry::operator=(entry&& e) + { + swap(e); + return *this; + } + entry::integer_type& entry::integer() { if (m_type == undefined_t) construct(int_t); @@ -281,6 +287,18 @@ namespace libtorrent #endif } + entry::entry(entry&& e) + : m_type(undefined_t) + { +#ifdef TORRENT_DEBUG + uint8_t type_queried = e.m_type_queried; +#endif + swap(e); +#ifdef TORRENT_DEBUG + m_type_queried = type_queried; +#endif + } + entry::entry(dictionary_type const& v) : m_type(undefined_t) {