Boost logo

Boost :

Subject: [boost] [iterators] zip_iterator doesn't work with GCC's TR1 tuple?
From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2008-12-08 23:35:41


Has anybody successfully used Boost.Iterator's zip_iterator with TR1
tuples from GCC's libstdc++?

I keep getting errors like "error: no type named 'head_type' in 'class
std::tr1::tuple<..." when using TR1 tuples with the zip_iterator
implementation in Boost 1.35.0 -- am I missing something? I have code
like this:

using namespace std::tr1;

vector<tuple<string, int, tuple<string, string, string> > > result;
copy(
  make_zip_iterator(
    make_tuple(
      string_vector.begin(),
      int_vector.begin(),
      make_zip_iterator(
        make_tuple(
          string_vector1.begin(),
          string_vector2.begin(),
          string_vector3.begin()
          )
        )
      )
    ),
  make_zip_iterator(
    make_tuple(
      string_vector.end(),
      int_vector.end(),
      make_zip_iterator(
        make_tuple(
          string_vector1.end(),
          string_vector2.end(),
          string_vector3.end()
          )
        )
      )
    ),
  back_inserter(result)
  );

When I qualify the call to 'make_tuple' as 'boost::make_tuple' I don't
see the error mentioned above, but I run into the conversion problem
between a boost::tuple and an std::tr1::tuple.

Any ideas how I can get around this?

-- 
Dean Michael C. Berris
Software Engineer, Friendster, Inc.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk