mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
fix(Core): C++ 11 rule of 3 compiant constructors (#3023)
This commit is contained in:
@@ -72,6 +72,12 @@ class ByteBuffer
|
||||
_storage(buf._storage)
|
||||
{
|
||||
}
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
ByteBuffer(ByteBuffer&&) = default;
|
||||
ByteBuffer& operator=(const ByteBuffer&) = default;
|
||||
ByteBuffer& operator=(ByteBuffer&&) = default;
|
||||
#endif
|
||||
|
||||
void clear()
|
||||
{
|
||||
@@ -374,18 +380,18 @@ class ByteBuffer
|
||||
return *this;
|
||||
}
|
||||
|
||||
uint8 * contents()
|
||||
{
|
||||
uint8 * contents()
|
||||
{
|
||||
if (_storage.empty())
|
||||
throw ByteBufferException();
|
||||
return &_storage[0];
|
||||
return &_storage[0];
|
||||
}
|
||||
|
||||
const uint8 *contents() const
|
||||
{
|
||||
const uint8 *contents() const
|
||||
{
|
||||
if (_storage.empty())
|
||||
throw ByteBufferException();
|
||||
return &_storage[0];
|
||||
return &_storage[0];
|
||||
}
|
||||
|
||||
size_t size() const { return _storage.size(); }
|
||||
@@ -612,4 +618,3 @@ inline void ByteBuffer::read_skip<std::string>()
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,6 +22,12 @@ class WorldPacket : public ByteBuffer
|
||||
WorldPacket(const WorldPacket &packet) : ByteBuffer(packet), m_opcode(packet.m_opcode)
|
||||
{
|
||||
}
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
WorldPacket(WorldPacket&&) = default;
|
||||
WorldPacket& operator=(const WorldPacket&) = default;
|
||||
WorldPacket& operator=(WorldPacket&&) = default;
|
||||
#endif
|
||||
|
||||
void Initialize(uint16 opcode, size_t newres=200)
|
||||
{
|
||||
@@ -37,4 +43,3 @@ class WorldPacket : public ByteBuffer
|
||||
uint16 m_opcode;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -449,6 +449,11 @@ public:
|
||||
part[2] = right.part[2];
|
||||
return *this;
|
||||
}
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
flag96(const flag96&) = default;
|
||||
flag96(flag96&&) = default;
|
||||
#endif
|
||||
|
||||
inline flag96 operator&(flag96 const& right) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user