Borland fixes

[SVN r9119]
This commit is contained in:
Dave Abrahams 2001-02-11 16:16:53 +00:00
parent 2ac273739c
commit 95ba69c00a

View File

@ -9,6 +9,7 @@
// See http://www.boost.org for most recent version including documentation. // See http://www.boost.org for most recent version including documentation.
// Revision History // Revision History
// 11 Feb 01 Borland fixes (David Abrahams)
// 10 Feb 01 Use new adaptors interface. (David Abrahams) // 10 Feb 01 Use new adaptors interface. (David Abrahams)
// 10 Feb 01 Use new filter_ interface. (David Abrahams) // 10 Feb 01 Use new filter_ interface. (David Abrahams)
// 09 Feb 01 Use new reverse_ and indirect_ interfaces. Replace // 09 Feb 01 Use new reverse_ and indirect_ interfaces. Replace
@ -210,6 +211,7 @@ main()
boost::random_access_iterator_test(j, N, array); boost::random_access_iterator_test(j, N, array);
boost::const_nonconst_iterator_test(i, ++j); boost::const_nonconst_iterator_test(i, ++j);
} }
// Test transform_iterator // Test transform_iterator
{ {
int x[N], y[N]; int x[N], y[N];
@ -285,6 +287,7 @@ main()
boost::const_nonconst_iterator_test(i, ++j); boost::const_nonconst_iterator_test(i, ++j);
} }
// Test reverse_iterator_generator // Test reverse_iterator_generator
{ {
dummyT reversed[N]; dummyT reversed[N];
@ -297,12 +300,6 @@ main()
#endif #endif
>::type reverse_iterator; >::type reverse_iterator;
typedef boost::reverse_iterator_generator<const dummyT*
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
, const dummyT
#endif
>::type const_reverse_iterator;
reverse_iterator i = reversed + N; reverse_iterator i = reversed + N;
boost::random_access_iterator_test(i, N, array); boost::random_access_iterator_test(i, N, array);
@ -310,6 +307,12 @@ main()
boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array); boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array);
#endif #endif
typedef boost::reverse_iterator_generator<const dummyT*
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
, const dummyT
#endif
>::type const_reverse_iterator;
const_reverse_iterator j = reversed + N; const_reverse_iterator j = reversed + N;
boost::random_access_iterator_test(j, N, array); boost::random_access_iterator_test(j, N, array);
@ -345,7 +348,7 @@ main()
const std::deque<dummyT>::const_iterator const_reversed = reversed; const std::deque<dummyT>::const_iterator const_reversed = reversed;
boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array); boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array);
#if !defined(__GNUC__) || defined(__SGI_STL_PORT) // GCC deque iterators don't allow all const/non-const comparisons #if !defined(__GNUC__) && !defined(__BORLANDC__) || defined(__SGI_STL_PORT) // GCC/Borland deque iterators don't allow all const/non-const comparisons
boost::const_nonconst_iterator_test(i, ++j); boost::const_nonconst_iterator_test(i, ++j);
#endif #endif
} }
@ -360,18 +363,21 @@ main()
// Test filter iterator // Test filter iterator
{ {
typedef boost::filter_iterator_generator<one_or_four, dummyT* // Using typedefs for filter_gen::type and filter_gen::policies_type
// confused Borland terribly.
typedef boost::detail::non_bidirectional_category<dummyT*>::type category;
typedef ::boost::filter_iterator_generator<one_or_four, dummyT*
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
, dummyT , dummyT
#endif #endif
> FilterGen; > filter_gen;
typedef FilterGen::type FilterIter;
typedef FilterGen::policies_type FilterPolicies; filter_gen::type i(array, filter_gen::policies_type(one_or_four(), array + N));
FilterIter i(array, FilterPolicies(one_or_four(), array + N));
boost::forward_iterator_test(i, dummyT(1), dummyT(4)); boost::forward_iterator_test(i, dummyT(1), dummyT(4));
enum { is_forward = boost::is_same< enum { is_forward = boost::is_same<
FilterIter::iterator_category, filter_gen::type::iterator_category,
std::forward_iterator_tag>::value }; std::forward_iterator_tag>::value };
BOOST_STATIC_ASSERT(is_forward); BOOST_STATIC_ASSERT(is_forward);