Boost logo

Boost Users :

Subject: [Boost-users] zip_iterator and std::tuple (tr1) on msvc10
From: MM (finjulhich_at_[hidden])
Date: 2012-03-08 17:06:43


Hi,

this code compiles:
#include <vector>
#include <list>
#include <algorithm>
#include <boost/iterator/zip_iterator.hpp>
#include <boost/tuple/tuple.hpp>

int main()
{
  const std::vector<int> vi(5u);
  const std::list<int> li(5u);

  std::for_each( boost::make_zip_iterator(boost::make_tuple(vi.begin(),
li.begin()) ), boost::make_zip_iterator(boost::make_tuple(vi.end(),
li.end() ) ),
    []( const boost::tuple<const int&, const int&>& tpl )
    {
      tpl;
    }
  );
  return 0;
}

but this code doesn't on msvc10:

#include <tuple>
#include <vector>
#include <list>
#include <algorithm>
#include <boost/iterator/zip_iterator.hpp>

int main()
{
  const std::vector<int> vi(5u);
  const std::list<int> li(5u);

  std::for_each( boost::make_zip_iterator( std::make_tuple(vi.begin(),
li.begin()) ), boost::make_zip_iterator( std::make_tuple(vi.end(), li.end()
) ),
    []( const std::tuple<const int&, const int&>& tpl )
    {
      tpl;
    }
  );
  return 0;
}

Is msvc10 std::tuple not std compliant, or not
boost::zip_iterator-compliant, or should zip_iterator impl change?

Rds,

MM


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net