Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
zip
Description

Zips sequences together to form a single sequence, whos members are tuples of the members of the component sequences.

Synopsis
template<
    typename Sequence1,
    typename Sequence2,
    ...
    typename SequenceN
    >
struct zip
{
    typedef unspecified type;
};
Expression Semantics
result_of::zip<Sequence1, Sequence2, ... SequenceN>::type

Return type: A model of the most restrictive traversal category of sequences Sequence1 to SequenceN.

Semantics: Return a sequence containing tuples of elements from each sequence. For example, applying zip to tuples (1, 2, 3) and ('a', 'b', 'c') would return ((1, 'a'),(2, 'b'),(3, 'c'))

Complexity

Constant.

Header
#include <boost/fusion/algorithm/transformation/zip.hpp>
#include <boost/fusion/include/zip.hpp>

PrevUpHomeNext