Added tests for BOOST_NO_STD_ITERATOR_TRAITS

[SVN r14654]
This commit is contained in:
John Maddock 2002-07-31 11:25:25 +00:00
parent 351d4ecb15
commit 1ea4140d56
4 changed files with 13 additions and 13 deletions

View File

@ -22,7 +22,7 @@ int main()
int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 }; int numbers_[] = { 0, -1, 4, -3, 5, 8, -2 };
const int N = sizeof(numbers_)/sizeof(int); 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 // Assume there won't be proper iterator traits for pointers. This
// is just a wrapper for int* which has the right traits. // is just a wrapper for int* which has the right traits.
typedef boost::iterator_adaptor<int*, boost::default_iterator_policies, int> base_iterator; typedef boost::iterator_adaptor<int*, boost::default_iterator_policies, int> base_iterator;

View File

@ -46,7 +46,7 @@ void more_indirect_iterator_tests()
typedef boost::indirect_iterator_pair_generator< typedef boost::indirect_iterator_pair_generator<
pointer_deque::iterator pointer_deque::iterator
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifdef BOOST_NO_STD_ITERATOR_TRAITS
, int , int
#endif #endif
> IndirectDeque; > IndirectDeque;
@ -75,7 +75,7 @@ void more_indirect_iterator_tests()
typedef boost::indirect_iterator_generator< typedef boost::indirect_iterator_generator<
iterator_set::iterator iterator_set::iterator
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifdef BOOST_NO_STD_ITERATOR_TRAITS
, int , int
#endif #endif
>::type indirect_set_iterator; >::type indirect_set_iterator;
@ -117,7 +117,7 @@ main()
ptr[k] = array + k; ptr[k] = array + k;
typedef boost::indirect_iterator_generator<dummyT** typedef boost::indirect_iterator_generator<dummyT**
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #ifdef BOOST_NO_STD_ITERATOR_TRAITS
, dummyT , dummyT
#endif #endif
>::type indirect_iterator; >::type indirect_iterator;
@ -127,7 +127,7 @@ main()
indirect_iterator i(ptr); indirect_iterator i(ptr);
boost::random_access_iterator_test(i, N, array); 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); boost::random_access_iterator_test(boost::make_indirect_iterator(ptr), N, array);
#endif #endif
@ -139,7 +139,7 @@ main()
dummyT*const* const_ptr = ptr; 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); boost::random_access_iterator_test(boost::make_indirect_iterator(const_ptr), N, array);
#endif #endif
boost::const_nonconst_iterator_test(i, ++j); boost::const_nonconst_iterator_test(i, ++j);

View File

@ -224,7 +224,7 @@ main()
std::reverse(reversed, reversed + N); std::reverse(reversed, reversed + N);
typedef boost::reverse_iterator_generator<dummyT* typedef boost::reverse_iterator_generator<dummyT*
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
, dummyT , dummyT
#endif #endif
>::type reverse_iterator; >::type reverse_iterator;
@ -232,12 +232,12 @@ main()
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);
#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); boost::random_access_iterator_test(boost::make_reverse_iterator(reversed + N), N, array);
#endif #endif
typedef boost::reverse_iterator_generator<const dummyT* typedef boost::reverse_iterator_generator<const dummyT*
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
, dummyT, const dummyT&, const dummyT , dummyT, const dummyT&, const dummyT
#endif #endif
>::type const_reverse_iterator; >::type const_reverse_iterator;
@ -247,7 +247,7 @@ main()
const dummyT* const_reversed = reversed; 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); boost::random_access_iterator_test(boost::make_reverse_iterator(const_reversed + N), N, array);
#endif #endif
@ -300,7 +300,7 @@ main()
typedef boost::detail::non_bidirectional_category<dummyT*>::type category; typedef boost::detail::non_bidirectional_category<dummyT*>::type category;
typedef boost::filter_iterator_generator<one_or_four, dummyT* typedef boost::filter_iterator_generator<one_or_four, dummyT*
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
, dummyT , dummyT
#endif #endif
>::type filter_iter; >::type filter_iter;
@ -348,7 +348,7 @@ main()
dummyT(4), dummyT(1)); dummyT(4), dummyT(1));
#endif #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::forward_iterator_test(
boost::make_filter_iterator(array+0, array+N, one_or_four()), boost::make_filter_iterator(array+0, array+N, one_or_four()),
dummyT(1), dummyT(4)); dummyT(1), dummyT(4));

View File

@ -12,7 +12,7 @@ int main(int, char*[])
{ {
char letters_[] = "hello world!"; char letters_[] = "hello world!";
const int N = sizeof(letters_)/sizeof(char) - 1; 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 // Assume there won't be proper iterator traits for pointers. This
// is just a wrapper for char* which has the right traits. // is just a wrapper for char* which has the right traits.
typedef boost::iterator_adaptor<char*, boost::default_iterator_policies, char> base_iterator; typedef boost::iterator_adaptor<char*, boost::default_iterator_policies, char> base_iterator;