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:
Yves
2015-01-24 16:33:27 +00:00
parent c02a7e1a7b
commit 15e8637b67
4 changed files with 79 additions and 4 deletions
+19
View File
@@ -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;