diff options
Diffstat (limited to 'Eigen/src/Core/Ref.h')
-rw-r--r-- | Eigen/src/Core/Ref.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Eigen/src/Core/Ref.h b/Eigen/src/Core/Ref.h index 09921c9e7..2653f2bbe 100644 --- a/Eigen/src/Core/Ref.h +++ b/Eigen/src/Core/Ref.h @@ -232,6 +232,15 @@ template<typename TPlainObjectType, int Options, typename StrideType> class Ref< construct(expr.derived(), typename Traits::template match<Derived>::type()); } + inline Ref(const Ref& other) : Base(other) { + // copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy + } + + template<typename OtherRef> + inline Ref(const RefBase<OtherRef>& other) { + construct(other.derived(), typename Traits::template match<OtherRef>::type()); + } + protected: template<typename Expression> |