Add a unit test for Ref.h and fix an extra copy.

This commit is contained in:
Gael Guennebaud
2013-02-26 15:10:00 +01:00
parent 63135a7350
commit bb94f0ebc6
3 changed files with 233 additions and 3 deletions

View File

@@ -172,7 +172,7 @@ protected:
else
::new (static_cast<Base*>(this)) Base(expr.data(), expr.rows(), expr.cols());
::new (&m_stride) StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(),
StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride());
}
StrideBase m_stride;
@@ -242,8 +242,7 @@ template<typename PlainObjectType, int Options, typename StrideType> class Ref<c
template<typename Expression>
void construct(const Expression& expr, internal::false_type)
{
// std::cout << "Ref: copy\n";
m_object = expr;
m_object.lazyAssign(expr);
Base::construct(m_object);
}