bug #266: backport changeset 7c99b38b7c

about support for c++11 move semantic
This commit is contained in:
Gael Guennebaud
2015-10-21 09:21:07 +02:00
parent a7c2e62a52
commit f444996a7a
7 changed files with 278 additions and 80 deletions

View File

@@ -437,6 +437,20 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
}
#endif
#ifdef EIGEN_HAVE_RVALUE_REFERENCES
PlainObjectBase(PlainObjectBase&& other)
: m_storage( std::move(other.m_storage) )
{
}
PlainObjectBase& operator=(PlainObjectBase&& other)
{
using std::swap;
swap(m_storage, other.m_storage);
return *this;
}
#endif
/** Copy constructor */
EIGEN_STRONG_INLINE PlainObjectBase(const PlainObjectBase& other)
: m_storage()