aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Swap.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core/Swap.h')
-rw-r--r--Eigen/src/Core/Swap.h24
1 files changed, 10 insertions, 14 deletions
diff --git a/Eigen/src/Core/Swap.h b/Eigen/src/Core/Swap.h
index abbef4443..5fb032866 100644
--- a/Eigen/src/Core/Swap.h
+++ b/Eigen/src/Core/Swap.h
@@ -63,6 +63,16 @@ template<typename ExpressionType> class SwapWrapper
return m_expression.const_cast_derived().coeffRef(index);
}
+ inline Scalar& coeffRef(Index row, Index col) const
+ {
+ return m_expression.coeffRef(row, col);
+ }
+
+ inline Scalar& coeffRef(Index index) const
+ {
+ return m_expression.coeffRef(index);
+ }
+
template<typename OtherDerived>
void copyCoeff(Index row, Index col, const DenseBase<OtherDerived>& other)
{
@@ -113,18 +123,4 @@ template<typename ExpressionType> class SwapWrapper
ExpressionType& m_expression;
};
-/** swaps *this with the expression \a other.
- *
- * \note \a other is only marked for internal reasons, but of course
- * it gets const-casted. One reason is that one will often call swap
- * on temporary objects (hence non-const references are forbidden).
- * Another reason is that lazyAssign takes a const argument anyway.
- */
-template<typename Derived>
-template<typename OtherDerived>
-void DenseBase<Derived>::swap(DenseBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
-{
- (SwapWrapper<Derived>(derived())).lazyAssign(other);
-}
-
#endif // EIGEN_SWAP_H