mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-28 11:12:37 +00:00
Fix build with Visual Studio
I've reverted this workaround before the SM31 commit because I thought it's only a problem with VS2010. Actually VS2013 still doesn't support C++11 well enough and still requires the workaround. Refs #2669, #2462 This was SVN commit r16215.
This commit is contained in:
@@ -394,6 +394,25 @@ private:
|
||||
|
||||
struct CustomType
|
||||
{
|
||||
// TODO: Move assignment operator and move constructor only have to be
|
||||
// explicitly defined for Visual Studio. VS2013 is still behind on C++11 support
|
||||
// What's missing is what they call "Rvalue references v3.0", see
|
||||
// https://msdn.microsoft.com/en-us/library/hh567368.aspx#rvref
|
||||
CustomType() {}
|
||||
CustomType& operator=(CustomType&& other)
|
||||
{
|
||||
m_Prototype = std::move(other.m_Prototype);
|
||||
m_Class = std::move(other.m_Class);
|
||||
m_Constructor = std::move(other.m_Constructor);
|
||||
return *this;
|
||||
}
|
||||
CustomType(CustomType&& other)
|
||||
{
|
||||
m_Prototype = std::move(other.m_Prototype);
|
||||
m_Class = std::move(other.m_Class);
|
||||
m_Constructor = std::move(other.m_Constructor);
|
||||
}
|
||||
|
||||
DefPersistentRooted<JSObject*> m_Prototype;
|
||||
JSClass* m_Class;
|
||||
JSNative m_Constructor;
|
||||
|
||||
Reference in New Issue
Block a user