From 48a81ef7ea134b614f17e2366f65e41c60c3fc32 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 13 Jul 2002 12:22:51 +0000 Subject: [PATCH] VC++ fixes [SVN r14435] --- binary_search_test.cpp | 2 +- counting_iterator_example.cpp | 6 ++++-- counting_iterator_test.cpp | 2 +- indirect_iterator_example.cpp | 2 +- indirect_iterator_test.cpp | 2 +- iterator_adaptor_test.cpp | 10 +++++----- numeric_traits_test.cpp | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/binary_search_test.cpp b/binary_search_test.cpp index 700a887..abcdc46 100644 --- a/binary_search_test.cpp +++ b/binary_search_test.cpp @@ -103,7 +103,7 @@ void random_sorted_sequence(T& seq) sort_by_value(seq); } -# if defined(BOOST_MSVC) && !defined(__SGI_STL_PORT) +# if defined(BOOST_MSVC) && BOOST_MSVC < 1300 && !defined(__SGI_STL_PORT) // VC6's standard lib doesn't have a template member function for list::sort() template <> void random_sorted_sequence(std::list& result) diff --git a/counting_iterator_example.cpp b/counting_iterator_example.cpp index 3817069..fd18ad1 100644 --- a/counting_iterator_example.cpp +++ b/counting_iterator_example.cpp @@ -35,13 +35,15 @@ int main(int, char*[]) std::vector::iterator> pointers; - // VC6 gets an internal compiler error on this -#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) // Use counting iterator to fill in the array of pointers. + // causes an ICE with MSVC6 +#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200) std::copy(boost::make_counting_iterator(numbers.begin()), boost::make_counting_iterator(numbers.end()), std::back_inserter(pointers)); +#endif +#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300) // Use indirect iterator to print out numbers by accessing // them through the array of pointers. std::cout << "indirectly printing out the numbers from 0 to " diff --git a/counting_iterator_test.cpp b/counting_iterator_test.cpp index 5aa6c53..1994a2e 100644 --- a/counting_iterator_test.cpp +++ b/counting_iterator_test.cpp @@ -247,7 +247,7 @@ int main() // wrapping an iterator or non-built-in integer type causes an INTERNAL // COMPILER ERROR in MSVC without STLport. I'm clueless as to why. -#if !defined(BOOST_MSVC) || defined(__SGI_STL_PORT) +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 || defined(__SGI_STL_PORT) // Test user-defined type. test_integer(); test_integer(); diff --git a/indirect_iterator_example.cpp b/indirect_iterator_example.cpp index fb2b608..542dc66 100644 --- a/indirect_iterator_example.cpp +++ b/indirect_iterator_example.cpp @@ -51,7 +51,7 @@ int main(int, char*[]) // Example of using make_indirect_iterator() -#ifndef BOOST_MSVC +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 std::copy(boost::make_indirect_iterator(pointers_to_chars), boost::make_indirect_iterator(pointers_to_chars + N), std::ostream_iterator(std::cout, ",")); diff --git a/indirect_iterator_test.cpp b/indirect_iterator_test.cpp index f05785c..d88380f 100644 --- a/indirect_iterator_test.cpp +++ b/indirect_iterator_test.cpp @@ -31,7 +31,7 @@ typedef std::set iterator_set; void more_indirect_iterator_tests() { // For some reason all heck breaks loose in the compiler under these conditions. -#if !defined(BOOST_MSVC) || !defined(__STL_DEBUG) +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 || !defined(__STL_DEBUG) storage store(1000); std::generate(store.begin(), store.end(), rand); diff --git a/iterator_adaptor_test.cpp b/iterator_adaptor_test.cpp index 74eca35..0199101 100644 --- a/iterator_adaptor_test.cpp +++ b/iterator_adaptor_test.cpp @@ -133,7 +133,7 @@ main() boost::function_requires< boost::RandomAccessIteratorPoliciesConcept< boost::default_iterator_policies, - boost::iterator_adaptor, + boost::iterator_adaptor, boost::iterator > >(); @@ -156,7 +156,7 @@ main() boost::default_iterator_policies, boost::value_type_is > Iter1; BOOST_STATIC_ASSERT((boost::is_same::value)); -#if defined(__BORLANDC__) || defined(BOOST_MSVC) +#if defined(__BORLANDC__) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300 // We currently don't know how to workaround this bug. BOOST_STATIC_ASSERT((boost::is_same::value)); BOOST_STATIC_ASSERT((boost::is_same::value)); @@ -282,7 +282,7 @@ main() // Many compilers' builtin deque iterators don't interoperate well, though // STLport fixes that problem. -#if defined(__SGI_STL_PORT) || !defined(__GNUC__) && !defined(__BORLANDC__) && !defined(BOOST_MSVC) +#if defined(__SGI_STL_PORT) || !defined(__GNUC__) && !defined(__BORLANDC__) && (!defined(BOOST_MSVC) || BOOST_MSVC > 1200) boost::const_nonconst_iterator_test(i, ++j); #endif } @@ -327,7 +327,7 @@ main() // On compilers not supporting partial specialization, we can do more type // deduction with deque iterators than with pointers... unless the library // is broken ;-( -#if !defined(BOOST_MSVC) || defined(__SGI_STL_PORT) +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 || defined(__SGI_STL_PORT) std::deque array2; std::copy(array+0, array+N, std::back_inserter(array2)); boost::forward_iterator_test( @@ -339,7 +339,7 @@ main() dummyT(1), dummyT(4)); #endif -#if !defined(BOOST_MSVC) // This just freaks MSVC out completely +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // This just freaks MSVC out completely boost::forward_iterator_test( boost::make_filter_iterator( boost::make_reverse_iterator(array2.end()), diff --git a/numeric_traits_test.cpp b/numeric_traits_test.cpp index df20f77..7be16c4 100644 --- a/numeric_traits_test.cpp +++ b/numeric_traits_test.cpp @@ -347,7 +347,7 @@ void test(Number* = 0) // factoring out difference_type for the assert below confused Borland :( typedef boost::detail::is_signed< -#ifndef BOOST_MSVC +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300 typename #endif boost::detail::numeric_traits::difference_type