mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-25 02:17:21 +02:00
category of each component iterator is reduced to a known category before we try to find a minimum.
Closes #1517 [SVN r58012]
This commit is contained in:
2
include/boost/iterator/zip_iterator.hpp
Executable file → Normal file
2
include/boost/iterator/zip_iterator.hpp
Executable file → Normal file
@ -357,7 +357,7 @@ namespace boost {
|
|||||||
{
|
{
|
||||||
typedef typename tuple_impl_specific::tuple_meta_transform<
|
typedef typename tuple_impl_specific::tuple_meta_transform<
|
||||||
IteratorTuple
|
IteratorTuple
|
||||||
, iterator_traversal<>
|
, pure_traversal_tag<iterator_traversal<> >
|
||||||
>::type tuple_of_traversal_tags;
|
>::type tuple_of_traversal_tags;
|
||||||
|
|
||||||
typedef typename tuple_impl_specific::tuple_meta_accumulate<
|
typedef typename tuple_impl_specific::tuple_meta_accumulate<
|
||||||
|
24
test/zip_iterator_test.cpp
Executable file → Normal file
24
test/zip_iterator_test.cpp
Executable file → Normal file
@ -46,6 +46,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <string>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/iterator/transform_iterator.hpp>
|
#include <boost/iterator/transform_iterator.hpp>
|
||||||
@ -60,6 +61,27 @@ struct pure_traversal
|
|||||||
typename boost::iterator_traversal<It>::type
|
typename boost::iterator_traversal<It>::type
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
||||||
|
/// Tests for https://svn.boost.org/trac/boost/ticket/1517
|
||||||
|
int to_value(int const &v)
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
void category_test()
|
||||||
|
{
|
||||||
|
std::list<int> rng1;
|
||||||
|
std::string rng2;
|
||||||
|
|
||||||
|
boost::make_zip_iterator(
|
||||||
|
boost::make_tuple(
|
||||||
|
boost::make_transform_iterator(rng1.begin(), &to_value), // BidirectionalInput
|
||||||
|
rng2.begin() // RandomAccess
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
///
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@ -70,6 +92,8 @@ struct pure_traversal
|
|||||||
int main( void )
|
int main( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
category_test();
|
||||||
|
|
||||||
std::cout << "\n"
|
std::cout << "\n"
|
||||||
<< "***********************************************\n"
|
<< "***********************************************\n"
|
||||||
<< "* *\n"
|
<< "* *\n"
|
||||||
|
Reference in New Issue
Block a user