aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/VectorwiseOp.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2019-11-14 11:45:52 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2019-11-14 11:45:52 +0100
commit8af045a28721a9401d423c0318ffb99696c78f31 (patch)
treea00a0f9a10ad34ae54064a648606cdd66c6545f5 /Eigen/src/Core/VectorwiseOp.h
parent75b4c0a3e0ce69d8908c9b7daf644d797a3b9c0d (diff)
bug #1774: fix VectorwiseOp::begin()/end() return types regarding constness.
Diffstat (limited to 'Eigen/src/Core/VectorwiseOp.h')
-rw-r--r--Eigen/src/Core/VectorwiseOp.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h
index db0b9f8c4..274501c61 100644
--- a/Eigen/src/Core/VectorwiseOp.h
+++ b/Eigen/src/Core/VectorwiseOp.h
@@ -1,7 +1,7 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
-// Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
+// Copyright (C) 2008-2019 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
@@ -286,14 +286,18 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** returns an iterator to the first row (rowwise) or column (colwise) of the nested expression.
* \sa end(), cbegin()
*/
- iterator begin() const { return iterator (m_matrix, 0); }
+ iterator begin() { return iterator (m_matrix, 0); }
+ /** const version of begin() */
+ const_iterator begin() const { return const_iterator(m_matrix, 0); }
/** const version of begin() */
const_iterator cbegin() const { return const_iterator(m_matrix, 0); }
/** returns an iterator to the row (resp. column) following the last row (resp. column) of the nested expression
* \sa begin(), cend()
*/
- iterator end() const { return iterator (m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }
+ iterator end() { return iterator (m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }
+ /** const version of end() */
+ const_iterator end() const { return const_iterator(m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }
/** const version of end() */
const_iterator cend() const { return const_iterator(m_matrix, m_matrix.template subVectors<DirectionType(Direction)>()); }