mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Added tests for BOOST_NO_STD_ITERATOR_TRAITS
[SVN r14654]
This commit is contained in:
parent
351d4ecb15
commit
1ea4140d56
@ -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<int*, boost::default_iterator_policies, int> base_iterator;
|
||||
|
@ -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<dummyT**
|
||||
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
#ifdef BOOST_NO_STD_ITERATOR_TRAITS
|
||||
, dummyT
|
||||
#endif
|
||||
>::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);
|
||||
|
@ -224,7 +224,7 @@ main()
|
||||
std::reverse(reversed, reversed + N);
|
||||
|
||||
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
|
||||
#endif
|
||||
>::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<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
|
||||
#endif
|
||||
>::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<dummyT*>::type category;
|
||||
|
||||
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
|
||||
#endif
|
||||
>::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));
|
||||
|
@ -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<char*, boost::default_iterator_policies, char> base_iterator;
|
||||
|
Loading…
x
Reference in New Issue
Block a user