Merge pull request #681 from ssiloti/entry-move

add move ctor to entry
This commit is contained in:
Arvid Norberg 2016-05-01 10:12:18 -04:00
commit 53ca04036e
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)
{