From c293c2e4562b5a8291dc251835cd547bc779e24a Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Tue, 6 Oct 2009 21:12:55 +0000 Subject: [PATCH] libs/numeric/ublas/test/triangular_access.cpp: fixed compile failure with MSVC 7.1 [SVN r56620] --- test/triangular_access.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/triangular_access.cpp b/test/triangular_access.cpp index cccf80d0..9777632b 100644 --- a/test/triangular_access.cpp +++ b/test/triangular_access.cpp @@ -14,6 +14,10 @@ #include "common/testhelper.hpp" +#ifdef BOOST_UBLAS_NO_NESTED_CLASS_RELATION +using boost::numeric::ublas::iterator1_tag; +using boost::numeric::ublas::iterator2_tag; +#endif template < class MAT > void test_iterator( MAT & A ) { @@ -26,8 +30,13 @@ void test_iterator( MAT & A ) { typename MAT::iterator1 it1_end = A.end1(); for ( ; it1 != it1_end; ++it1 ) { +#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION typename MAT::iterator2 it2 = it1.begin(); typename MAT::iterator2 it2_end = it1.end(); +#else + typename MAT::iterator2 it2 = begin(it1, iterator1_tag()); + typename MAT::iterator2 it2_end = end(it1, iterator1_tag()); +#endif for ( ; it2 != it2_end ; ++ it2 ) { #ifndef NOMESSAGES std::cout << "( " << it2.index1() << ", " << it2.index2() << ") " << std::flush; @@ -52,8 +61,13 @@ void test_iterator2( MAT & A ) { typename MAT::iterator2 it2_end = A.end2(); for ( ; it2 != it2_end; ++it2 ) { +#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION typename MAT::iterator1 it1 = it2.begin(); typename MAT::iterator1 it1_end = it2.end(); +#else + typename MAT::iterator1 it1 = begin(it2, iterator2_tag()); + typename MAT::iterator1 it1_end = end(it2, iterator2_tag()); +#endif for ( ; it1 != it1_end ; ++ it1 ) { #ifndef NOMESSAGES std::cout << "( " << it1.index1() << ", " << it1.index2() << ") " << std::flush; @@ -81,8 +95,13 @@ test_iterator3( const MAT & A ) { typename MAT::const_iterator1 it1_end = A.end1(); for ( ; it1 != it1_end; ++it1 ) { +#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION typename MAT::const_iterator2 it2 = it1.begin(); typename MAT::const_iterator2 it2_end = it1.end(); +#else + typename MAT::const_iterator2 it2 = begin(it1, iterator1_tag()); + typename MAT::const_iterator2 it2_end = end(it1, iterator1_tag()); +#endif for ( ; it2 != it2_end ; ++ it2 ) { #ifndef NOMESSAGES std::cout << "( " << it2.index1() << ", " << it2.index2() << ") " << std::flush;