diff options
author | dergoegge <n.goeggi@gmail.com> | 2023-03-24 13:13:07 +0100 |
---|---|---|
committer | dergoegge <n.goeggi@gmail.com> | 2023-03-27 16:00:01 +0200 |
commit | b5a85b365a4abd98176b0935015dbb502cc3e6f6 (patch) | |
tree | 712b2915eb2f5b766359abcddf77ccc717833eca /src/net.h | |
parent | 630756cac0734df34e347bc5745c72d8ee521b09 (diff) |
[net] Delete CNetMessage copy constructor/assignment op
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -236,6 +236,14 @@ public: std::string m_type; CNetMessage(CDataStream&& recv_in) : m_recv(std::move(recv_in)) {} + // Only one CNetMessage object will exist for the same message on either + // the receive or processing queue. For performance reasons we therefore + // delete the copy constructor and assignment operator to avoid the + // possibility of copying CNetMessage objects. + CNetMessage(CNetMessage&&) = default; + CNetMessage(const CNetMessage&) = delete; + CNetMessage& operator=(CNetMessage&&) = default; + CNetMessage& operator=(const CNetMessage&) = delete; void SetVersion(int nVersionIn) { |