fix order of ctors and assignment operators

This commit is contained in:
Stephen Birarda 2015-07-22 14:15:17 -07:00
parent 023f3b8134
commit 5bed3502ef
2 changed files with 10 additions and 9 deletions

View file

@ -101,14 +101,6 @@ NLPacket::NLPacket(const NLPacket& other) : Packet(other) {
_sourceID = other._sourceID;
}
NLPacket& NLPacket::operator=(const NLPacket& other) {
Packet::operator=(other);
_sourceID = other._sourceID;
return *this;
}
NLPacket::NLPacket(std::unique_ptr<char> data, qint64 size, const HifiSockAddr& senderSockAddr) :
Packet(std::move(data), size, senderSockAddr)
{
@ -126,6 +118,14 @@ NLPacket::NLPacket(NLPacket&& other) :
_sourceID = std::move(other._sourceID);
}
NLPacket& NLPacket::operator=(const NLPacket& other) {
Packet::operator=(other);
_sourceID = other._sourceID;
return *this;
}
NLPacket& NLPacket::operator=(NLPacket&& other) {
Packet::operator=(std::move(other));

View file

@ -51,8 +51,9 @@ protected:
NLPacket(std::unique_ptr<char> data, qint64 size, const HifiSockAddr& senderSockAddr);
NLPacket(std::unique_ptr<Packet> packet);
NLPacket(const NLPacket& other);
NLPacket& operator=(const NLPacket& other);
NLPacket(NLPacket&& other);
NLPacket& operator=(const NLPacket& other);
NLPacket& operator=(NLPacket&& other);
void readSourceID();