Add PlainObjectBase copy ctor from PlainObjectBase and DenseBase objects. (manual backport from default branch, fix segfault when creating PlainObjectBase object, though such an usage is not recommended at all)

This commit is contained in:
Gael Guennebaud 2015-09-28 15:51:00 +02:00
parent f1583e86f6
commit cfe315476f

View File

@ -437,6 +437,22 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
}
#endif
/** Copy constructor */
EIGEN_STRONG_INLINE PlainObjectBase(const PlainObjectBase& other)
: m_storage()
{
_check_template_params();
lazyAssign(other);
}
template<typename OtherDerived>
EIGEN_STRONG_INLINE PlainObjectBase(const DenseBase<OtherDerived> &other)
: m_storage()
{
_check_template_params();
lazyAssign(other);
}
EIGEN_STRONG_INLINE PlainObjectBase(Index a_size, Index nbRows, Index nbCols)
: m_storage(a_size, nbRows, nbCols)
{