diff --git a/test/permutation_iterator_test.cpp b/test/permutation_iterator_test.cpp index abd1046..6d14218 100644 --- a/test/permutation_iterator_test.cpp +++ b/test/permutation_iterator_test.cpp @@ -18,6 +18,23 @@ #include +// This test checks for convertibility/interoperability among similar +// permutation iterators. We're not using container iterators +// underneath, as in permutation_test, because of bugs in GCC-3.3's +// __normal_iterator that make is_convertible choke when testing +// convertibility. +void iterop_test() +{ + typedef boost::permutation_iterator< double*, int const* > permutation_type; + typedef boost::permutation_iterator< double const*, int const* > permutation_const_type; + + BOOST_CONCEPT_ASSERT(( + boost_concepts::InteroperableIteratorConcept< + permutation_type + , permutation_const_type + >)); +} + void permutation_test() { // Example taken from documentation of old permutation_iterator. @@ -41,14 +58,6 @@ void permutation_test() permutation_type begin = boost::make_permutation_iterator( elements.begin(), indices.begin() ); permutation_type it = begin; permutation_type end = boost::make_permutation_iterator( elements.begin(), indices.end() ); - - typedef boost::permutation_iterator< element_range_type::const_iterator, index_type::iterator > permutation_const_type; - - BOOST_CONCEPT_ASSERT(( - boost_concepts::InteroperableIteratorConcept< - permutation_type - , permutation_const_type - >)); BOOST_CHECK( it == begin ); BOOST_CHECK( it != end );