add move ctor to entry

This commit is contained in:
Steven Siloti 2016-04-30 20:44:48 -07:00
parent ff0675e64e
commit f0b92a2047
2 changed files with 20 additions and 0 deletions

View File

@ -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&);

View File

@ -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)
{