aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/DenseBase.h
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <ezhulenev@google.com>2018-10-09 15:28:23 -0700
committerGravatar Eugene Zhulenev <ezhulenev@google.com>2018-10-09 15:28:23 -0700
commitc0ca8a9fa3e03ad7ecb270adfe760a1bff7c0829 (patch)
tree6e38debca47aff72e7c68207bb1d705c4339024e /Eigen/src/Core/DenseBase.h
parent3f2c8b7ff067c4a6cf00688a171c5a05154ee39b (diff)
Compile time detection for unimplemented stl-style iterators
Diffstat (limited to 'Eigen/src/Core/DenseBase.h')
-rw-r--r--Eigen/src/Core/DenseBase.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h
index 0c34bce40..eedeacc94 100644
--- a/Eigen/src/Core/DenseBase.h
+++ b/Eigen/src/Core/DenseBase.h
@@ -583,11 +583,23 @@ template<typename Derived> class DenseBase
typedef typename internal::conditional< (Flags&DirectAccessBit)==DirectAccessBit,
internal::pointer_based_stl_iterator<Derived>,
internal::generic_randaccess_stl_iterator<Derived>
- >::type iterator;
+ >::type iterator_type;
typedef typename internal::conditional< (Flags&DirectAccessBit)==DirectAccessBit,
internal::pointer_based_stl_iterator<const Derived>,
internal::generic_randaccess_stl_iterator<const Derived>
+ >::type const_iterator_type;
+
+ // Stl-style iterators are supported only for vectors.
+
+ typedef typename internal::conditional< IsVectorAtCompileTime,
+ iterator_type,
+ internal::not_an_iterator<const Derived>
+ >::type iterator;
+
+ typedef typename internal::conditional< IsVectorAtCompileTime,
+ const_iterator_type,
+ internal::not_an_iterator<const Derived>
>::type const_iterator;
#endif