From 1bf28b3de2eda99687ca62054abaf23be34eb621 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 9 Jan 2002 12:11:37 +0000 Subject: [PATCH] Fixes for Borland [SVN r12254] --- counting_iterator_test.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/counting_iterator_test.cpp b/counting_iterator_test.cpp index 6a18f85..62f1e57 100644 --- a/counting_iterator_test.cpp +++ b/counting_iterator_test.cpp @@ -27,7 +27,9 @@ #include #include #include -#include +#ifndef __BORLANDC__ +# include +#endif #include #include #include @@ -72,8 +74,12 @@ void category_test( // Try some binary searches on the range to show that it's ordered assert(std::binary_search(start, finish, *internal)); - CountingIterator x,y; - boost::tie(x,y) = std::equal_range(start, finish, *internal); + + // #including tuple crashed borland, so I had to give up on tie(). + std::pair xy( + std::equal_range(start, finish, *internal)); + CountingIterator x = xy.first, y = xy.second; + assert(boost::detail::distance(x, y) == 1); // Show that values outside the range can't be found @@ -253,7 +259,7 @@ int main() # ifndef BOOST_NO_SLIST test_container >(); # endif - + // Also prove that we can handle raw pointers. int array[2000]; test(boost::make_counting_iterator(array), boost::make_counting_iterator(array+2000-1));