Class template zip_iterator

| Home | Libraries | People | FAQ | More

## Class template zip_iterator

boost::compute::zip_iterator — A zip iterator adaptor.

## Synopsis

    // In header: <boost/compute/iterator/zip_iterator.hpp>

    template<typename IteratorTuple>
    class zip_iterator {
    public:
      // types
      typedef unspecified                 super_type;
      typedef super_type::value_type      value_type;
      typedef super_type::reference       reference;
      typedef super_type::difference_type difference_type;
      typedef IteratorTuple               iterator_tuple;

      // construct/copy/destruct
      zip_iterator(IteratorTuple);
      zip_iterator(const zip_iterator< IteratorTuple > &);
      zip_iterator< IteratorTuple > &
      operator=(const zip_iterator< IteratorTuple > &);
      ~zip_iterator();

      // public member functions
      const IteratorTuple & get_iterator_tuple() const;
      template<typename IndexExpression>
        unspecified operator[](const IndexExpression &) const;

      // private member functions
      reference dereference() const;
      bool equal(const zip_iterator< IteratorTuple > &) const;
      void increment();
      void decrement();
      void advance(difference_type);
      difference_type distance_to(const zip_iterator< IteratorTuple > &) const;
    };

## Description

The zip_iterator class combines values from multiple input iterators. When dereferenced it returns a tuple containing each value at the current position in each input range.

See Also:

make_zip_iterator()

### `zip_iterator` public construct/copy/destruct

1.     zip_iterator(IteratorTuple iterators);

2.     zip_iterator(const zip_iterator< IteratorTuple > & other);

3.     zip_iterator< IteratorTuple > &
       operator=(const zip_iterator< IteratorTuple > & other);

4.     ~zip_iterator();

### `zip_iterator` public member functions

1.     const IteratorTuple & get_iterator_tuple() const;

2.     template<typename IndexExpression>
         unspecified operator[](const IndexExpression & expr) const;

### `zip_iterator` private member functions

1.     reference dereference() const;

2.     bool equal(const zip_iterator< IteratorTuple > & other) const;

3.     void increment();

4.     void decrement();

5.     void advance(difference_type n);

6.     difference_type distance_to(const zip_iterator< IteratorTuple > & other) const;