source: NonGTP/Boost/boost/mpl/zip_view.hpp @ 857

Revision 857, 1.6 KB checked in by igarcia, 19 years ago (diff)
RevLine 
[857]1
2#ifndef BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
3#define BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
4
5// Copyright Aleksey Gurtovoy 2000-2002
6// Copyright David Abrahams 2000-2002
7//
8// Distributed under the Boost Software License, Version 1.0.
9// (See accompanying file LICENSE_1_0.txt or copy at
10// http://www.boost.org/LICENSE_1_0.txt)
11//
12// See http://www.boost.org/libs/mpl for documentation.
13
14// $Source: /cvsroot/boost/boost/boost/mpl/zip_view.hpp,v $
15// $Date: 2004/09/02 15:40:42 $
16// $Revision: 1.3 $
17
18#include <boost/mpl/transform.hpp>
19#include <boost/mpl/begin_end.hpp>
20#include <boost/mpl/iterator_tags.hpp>
21#include <boost/mpl/next.hpp>
22#include <boost/mpl/lambda.hpp>
23#include <boost/mpl/deref.hpp>
24#include <boost/mpl/aux_/na_spec.hpp>
25
26namespace boost { namespace mpl {
27
28template< typename IteratorSeq >
29struct zip_iterator
30{
31    typedef forward_iterator_tag category;
32    typedef typename transform1<
33          IteratorSeq
34        , deref<_1>
35        >::type type;
36
37    typedef zip_iterator<
38          typename transform1<
39                IteratorSeq
40              , next<_1>
41            >::type
42        > next;
43};
44
45template<
46      typename BOOST_MPL_AUX_NA_PARAM(Sequences)
47    >
48struct zip_view
49{
50 private:
51    typedef typename transform1< Sequences, begin<_1> >::type first_ones_;
52    typedef typename transform1< Sequences, end<_1> >::type last_ones_;
53   
54 public:
55    typedef nested_begin_end_tag tag;
56    typedef zip_iterator<first_ones_> begin;
57    typedef zip_iterator<last_ones_> end;
58};
59
60BOOST_MPL_AUX_NA_SPEC(1, zip_view)
61
62}}
63
64#endif // BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
Note: See TracBrowser for help on using the repository browser.