From 522195fd64cff2701b49cc73443618cc94480a2c Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 20 Nov 2003 21:36:54 +0000 Subject: [PATCH] Stop making the incorrect assumption that x == j[n] is legitimate whenever x = j[n] and x == x are. j[n] may be a proxy convertible to typeof(x) and x == x may use a templated operator==, which wouldn't match the proxy. [SVN r20887] --- include/boost/pending/iterator_tests.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index 4be1044..5be7b0f 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -25,6 +25,8 @@ # include # include # include // for detail::dummy_constructor +# include +# include namespace boost { @@ -38,6 +40,11 @@ struct dummyT { int m_x; }; +} + +BOOST_TT_BROKEN_COMPILER_SPEC(boost::dummyT) + +namespace boost { // Tests whether type Iterator satisfies the requirements for a // TrivialIterator. @@ -211,10 +218,12 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) const Iterator j = i; int c; + typedef typename boost::detail::iterator_traits::value_type value_type; + for (c = 0; c < N-1; ++c) { assert(i == j + c); assert(*i == vals[c]); - assert(*i == j[c]); + assert(*i == boost::implicit_cast(j[c])); assert(*i == *(j + c)); assert(*i == *(c + j)); ++i; @@ -228,7 +237,7 @@ void random_access_iterator_test(Iterator i, int N, TrueVals vals) for (c = 0; c < N-1; ++c) { assert(i == k - c); assert(*i == vals[N - 1 - c]); - assert(*i == j[N - 1 - c]); + assert(*i == boost::implicit_cast(j[N - 1 - c])); Iterator q = k - c; assert(*i == *q); assert(i > j);