Subject: [Boost-bugs] [Boost C++ Libraries] #1860: zip_iterator::value_type should not be reference
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-24 18:39:19
#1860: zip_iterator::value_type should not be reference
--------------------------+-------------------------------------------------
Reporter: anonymous | Owner: dave
Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: iterator
Version: Boost 1.35.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
hi,
defining zip_iterator::value_type in the boost.iterator library to be
the same as the reference type breaks some mutating algorithms on
zip_iterators. for example sort:
{{{
template<class Array1,class Array2>
void array_multisort(Array1& array1, Array2& array2)
{
using namespace boost;
std::sort(make_zip_iterator(make_tuple(array1.begin(), array2.begin())),
make_zip_iterator(make_tuple(array1.end(), array2.end())));
}
}}}
won't work as expected. Patching zip_iterator to provide a more natural
value_type makes the above code work as intended. The patch is attached
to this message.
mfg thomas
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1860>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC