Added use of C++11 defaulted and deleted constructors
This commit is contained in:
Родитель
9ac1667ca4
Коммит
fcf879ee93
|
@ -48,7 +48,7 @@ struct _EDGE {
|
|||
DirectX::XMFLOAT2 p2;
|
||||
DirectX::XMFLOAT2 minP;
|
||||
DirectX::XMFLOAT2 maxP;
|
||||
_EDGE() {};
|
||||
_EDGE() DIRECTX_CTOR_DEFAULT
|
||||
_EDGE(const DirectX::XMFLOAT2& _p1, const DirectX::XMFLOAT2& _p2) : p1(_p1), p2(_p2) {
|
||||
minP.x = std::min(p1.x, p2.x);
|
||||
maxP.x = std::max(p1.x, p2.x);
|
||||
|
|
|
@ -1617,8 +1617,8 @@ public:
|
|||
|
||||
private:
|
||||
// Prevent copying
|
||||
VertFaceIter(VertFaceIter const&);
|
||||
VertFaceIter& operator=(VertFaceIter const&);
|
||||
VertFaceIter(VertFaceIter const&) DIRECTX_CTOR_DELETE
|
||||
VertFaceIter& operator=(VertFaceIter const&) DIRECTX_CTOR_DELETE
|
||||
};
|
||||
|
||||
HRESULT CIsochartMesh::CleanNonmanifoldMesh(bool& bCleaned)
|
||||
|
|
|
@ -1329,8 +1329,8 @@ private:
|
|||
#endif
|
||||
|
||||
// Prevent copying
|
||||
CIsochartMesh(CIsochartMesh const&);
|
||||
CIsochartMesh& operator=(CIsochartMesh const&);
|
||||
CIsochartMesh(CIsochartMesh const&) DIRECTX_CTOR_DELETE
|
||||
CIsochartMesh& operator=(CIsochartMesh const&) DIRECTX_CTOR_DELETE
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace Isochart
|
|||
CCallbackSchemer& m_callbackSchemer;
|
||||
|
||||
// Prevent copying
|
||||
CProgressiveMesh(CProgressiveMesh const&);
|
||||
CProgressiveMesh& operator=(CProgressiveMesh const&);
|
||||
CProgressiveMesh(CProgressiveMesh const&) DIRECTX_CTOR_DELETE
|
||||
CProgressiveMesh& operator=(CProgressiveMesh const&) DIRECTX_CTOR_DELETE
|
||||
};
|
||||
}
|
||||
|
|
|
@ -21,6 +21,17 @@
|
|||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
// VS 2010/2012 do not support =default =delete
|
||||
#ifndef DIRECTX_CTOR_DEFAULT
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1800)
|
||||
#define DIRECTX_CTOR_DEFAULT {}
|
||||
#define DIRECTX_CTOR_DELETE ;
|
||||
#else
|
||||
#define DIRECTX_CTOR_DEFAULT =default;
|
||||
#define DIRECTX_CTOR_DELETE =delete;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include <objbase.h>
|
||||
|
||||
|
|
|
@ -128,6 +128,6 @@ private:
|
|||
std::unique_ptr<DirectX::XMFLOAT4[]> mBlendWeights;
|
||||
|
||||
// Prevent copying
|
||||
Mesh(Mesh const&);
|
||||
Mesh& operator= (Mesh const&);
|
||||
Mesh(Mesh const&) DIRECTX_CTOR_DELETE
|
||||
Mesh& operator= (Mesh const&) DIRECTX_CTOR_DELETE
|
||||
};
|
Загрузка…
Ссылка в новой задаче