fix(Core): C++ 11 rule of 3 compiant constructors (#3023)
This commit is contained in:
parent
ebec48e6fd
commit
a12e58b105
7 changed files with 79 additions and 35 deletions
5
deps/g3dlite/include/G3D/Vector3.h
vendored
5
deps/g3dlite/include/G3D/Vector3.h
vendored
|
|
@ -116,6 +116,11 @@ public:
|
|||
|
||||
// assignment and comparison
|
||||
Vector3& __fastcall operator= (const Vector3& rkVector);
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
Vector3(const Vector3&) = default;
|
||||
Vector3(Vector3&&) = default;
|
||||
#endif
|
||||
bool operator== (const Vector3& rkVector) const;
|
||||
bool operator!= (const Vector3& rkVector) const;
|
||||
size_t hashCode() const;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -376,6 +376,12 @@ struct Position
|
|||
: m_positionX(x), m_positionY(y), m_positionZ(z), m_orientation(NormalizeOrientation(o)) { }
|
||||
|
||||
Position(Position const& loc) { Relocate(loc); }
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
Position(Position&&) = default;
|
||||
Position& operator=(const Position&) = default;
|
||||
Position& operator=(Position&&) = default;
|
||||
#endif
|
||||
|
||||
struct PositionXYStreamer
|
||||
{
|
||||
|
|
@ -639,7 +645,13 @@ class WorldLocation : public Position
|
|||
public:
|
||||
explicit WorldLocation(uint32 _mapid = MAPID_INVALID, float _x = 0, float _y = 0, float _z = 0, float _o = 0)
|
||||
: m_mapId(_mapid) { Relocate(_x, _y, _z, _o); }
|
||||
WorldLocation(const WorldLocation &loc) { WorldRelocate(loc); }
|
||||
WorldLocation(const WorldLocation &loc) : Position () { WorldRelocate(loc); }
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
WorldLocation(WorldLocation&&) = default;
|
||||
WorldLocation& operator=(const WorldLocation&) = default;
|
||||
WorldLocation& operator=(WorldLocation&&) = default;
|
||||
#endif
|
||||
|
||||
void WorldRelocate(const WorldLocation &loc)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1314,6 +1314,12 @@ public:
|
|||
_posOwner.Relocate(c._posOwner);
|
||||
_posTarget.Relocate(c._posTarget);
|
||||
}
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
MMapTargetData(MMapTargetData&&) = default;
|
||||
MMapTargetData& operator=(const MMapTargetData&) = default;
|
||||
MMapTargetData& operator=(MMapTargetData&&) = default;
|
||||
#endif
|
||||
bool PosChanged(const Position& o, const Position& t) const
|
||||
{
|
||||
return _posOwner.GetExactDistSq(&o) > 0.5f*0.5f || _posTarget.GetExactDistSq(&t) > 0.5f*0.5f;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,12 @@ namespace Movement
|
|||
MoveSplineFlag() { raw() = 0; }
|
||||
MoveSplineFlag(uint32 f) { raw() = f; }
|
||||
MoveSplineFlag(const MoveSplineFlag& f) { raw() = f.raw(); }
|
||||
/* requried as of C++ 11 */
|
||||
#if __cplusplus >= 201103L
|
||||
MoveSplineFlag(MoveSplineFlag&&) = default;
|
||||
MoveSplineFlag& operator=(const MoveSplineFlag&) = default;
|
||||
MoveSplineFlag& operator=(MoveSplineFlag&&) = default;
|
||||
#endif
|
||||
|
||||
// Constant interface
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue