From 0105146915c62f732841bb63d5c2046ed7cb3864 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 10 Nov 2018 09:11:38 +0100 Subject: [PATCH] Fix warning in c++03 --- Eigen/src/Core/StlIterators.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/StlIterators.h b/Eigen/src/Core/StlIterators.h index 131a95085..4f25a60c4 100644 --- a/Eigen/src/Core/StlIterators.h +++ b/Eigen/src/Core/StlIterators.h @@ -23,8 +23,9 @@ protected: typedef indexed_based_stl_iterator_base non_const_iterator; typedef indexed_based_stl_iterator_base const_iterator; typedef typename internal::conditional::value,non_const_iterator,const_iterator>::type other_iterator; - friend const_iterator; - friend non_const_iterator; + // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: + friend class indexed_based_stl_iterator_base; + friend class indexed_based_stl_iterator_base; public: typedef Index difference_type; typedef std::random_access_iterator_tag iterator_category; @@ -99,8 +100,9 @@ class pointer_based_stl_iterator typedef pointer_based_stl_iterator::type> non_const_iterator; typedef pointer_based_stl_iterator::type> const_iterator; typedef typename internal::conditional::value,non_const_iterator,const_iterator>::type other_iterator; - friend const_iterator; - friend non_const_iterator; + // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class: + friend class pointer_based_stl_iterator::type>; + friend class pointer_based_stl_iterator::type>; public: typedef Index difference_type; typedef typename XprType::Scalar value_type;