From 218778bb947a61a916304a5a33ea334a59349271 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 20 Nov 2003 21:17:54 +0000 Subject: [PATCH] Workarounds for broken compilers [SVN r20886] --- include/boost/iterator/new_iterator_tests.hpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/boost/iterator/new_iterator_tests.hpp b/include/boost/iterator/new_iterator_tests.hpp index 6169080..c16b826 100644 --- a/include/boost/iterator/new_iterator_tests.hpp +++ b/include/boost/iterator/new_iterator_tests.hpp @@ -27,6 +27,8 @@ # include # include +# include + namespace boost { // Preconditions: *i == v @@ -75,7 +77,7 @@ void constant_lvalue_iterator_test(Iterator i, T v1) BOOST_STATIC_ASSERT((is_same::value)); const T& v2 = *i2; assert(v1 == v2); -# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) +# ifndef BOOST_NO_LVALUE_RETURN_DETECTION BOOST_STATIC_ASSERT(is_lvalue_iterator::value); BOOST_STATIC_ASSERT(!is_non_const_lvalue_iterator::value); # endif @@ -90,10 +92,14 @@ void non_const_lvalue_iterator_test(Iterator i, T v1, T v2) BOOST_STATIC_ASSERT((is_same::value)); T& v3 = *i2; assert(v1 == v3); - // *i = v2; -- A non-const lvalue iterator is not neccessarily writable + + // A non-const lvalue iterator is not neccessarily writable, but we + // are assuming the value_type is assignable here + *i = v2; + T& v4 = *i2; assert(v2 == v4); -# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) +# ifndef BOOST_NO_LVALUE_RETURN_DETECTION BOOST_STATIC_ASSERT(is_lvalue_iterator::value); BOOST_STATIC_ASSERT(is_non_const_lvalue_iterator::value); # endif @@ -201,8 +207,8 @@ void random_access_readable_iterator_test(Iterator i, int N, TrueVals vals) } } -// #if 0'd code snipped; see CVS v 1.4 if you need it back - } // namespace boost +# include + #endif // BOOST_NEW_ITERATOR_TESTS_HPP