From 1ea4140d56fe34e4ef6edd6094c41a21f59b694d Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 31 Jul 2002 11:25:25 +0000 Subject: [PATCH] Added tests for BOOST_NO_STD_ITERATOR_TRAITS [SVN r14654] --- filter_iterator_example.cpp | 2 +- indirect_iterator_test.cpp | 10 +++++----- iterator_adaptor_test.cpp | 12 ++++++------ reverse_iterator_example.cpp | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/filter_iterator_example.cpp b/filter_iterator_example.cpp index bcec35d..9e4958a 100644 --- a/filter_iterator_example.cpp +++ b/filter_iterator_example.cpp @@ -22,7 +22,7 @@ int main() int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 }; const int N = sizeof(numbers_)/sizeof(int); -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#ifdef BOOST_NO_STD_ITERATOR_TRAITS // Assume there won't be proper iterator traits for pointers. This // is just a wrapper for int* which has the right traits. typedef boost::iterator_adaptor base_iterator; diff --git a/indirect_iterator_test.cpp b/indirect_iterator_test.cpp index d88380f..4b0c3e6 100644 --- a/indirect_iterator_test.cpp +++ b/indirect_iterator_test.cpp @@ -46,7 +46,7 @@ void more_indirect_iterator_tests() typedef boost::indirect_iterator_pair_generator< pointer_deque::iterator -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#ifdef BOOST_NO_STD_ITERATOR_TRAITS , int #endif > IndirectDeque; @@ -75,7 +75,7 @@ void more_indirect_iterator_tests() typedef boost::indirect_iterator_generator< iterator_set::iterator -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#ifdef BOOST_NO_STD_ITERATOR_TRAITS , int #endif >::type indirect_set_iterator; @@ -117,7 +117,7 @@ main() ptr[k] = array + k; typedef boost::indirect_iterator_generator::type indirect_iterator; @@ -127,7 +127,7 @@ main() indirect_iterator i(ptr); boost::random_access_iterator_test(i, N, array); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#ifndef BOOST_NO_STD_ITERATOR_TRAITS boost::random_access_iterator_test(boost::make_indirect_iterator(ptr), N, array); #endif @@ -139,7 +139,7 @@ main() dummyT*const* const_ptr = ptr; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#ifndef BOOST_NO_STD_ITERATOR_TRAITS boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array); #endif boost::const_nonconst_iterator_test(i, ++j); diff --git a/iterator_adaptor_test.cpp b/iterator_adaptor_test.cpp index 0199101..4773f13 100644 --- a/iterator_adaptor_test.cpp +++ b/iterator_adaptor_test.cpp @@ -224,7 +224,7 @@ main() std::reverse(reversed, reversed + N); typedef boost::reverse_iterator_generator::type reverse_iterator; @@ -232,12 +232,12 @@ main() reverse_iterator i(reversed + N); boost::random_access_iterator_test(i, N, array); -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array); #endif typedef boost::reverse_iterator_generator::type const_reverse_iterator; @@ -247,7 +247,7 @@ main() const dummyT* const_reversed = reversed; -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array); #endif @@ -300,7 +300,7 @@ main() typedef boost::detail::non_bidirectional_category::type category; typedef boost::filter_iterator_generator::type filter_iter; @@ -348,7 +348,7 @@ main() dummyT(4), dummyT(1)); #endif -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) boost::forward_iterator_test( boost::make_filter_iterator(array+0, array+N, one_or_four()), dummyT(1), dummyT(4)); diff --git a/reverse_iterator_example.cpp b/reverse_iterator_example.cpp index f80bd1b..39cabba 100644 --- a/reverse_iterator_example.cpp +++ b/reverse_iterator_example.cpp @@ -12,7 +12,7 @@ int main(int, char*[]) { char letters_[] = "hello world!"; const int N = sizeof(letters_)/sizeof(char) - 1; -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#ifdef BOOST_NO_STD_ITERATOR_TRAITS // Assume there won't be proper iterator traits for pointers. This // is just a wrapper for char* which has the right traits. typedef boost::iterator_adaptor base_iterator;