Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 #ifndef BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
3 #define BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
5 // Copyright David Abrahams 2003-2004
6 // Copyright Aleksey Gurtovoy 2004
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)
12 // See http://www.boost.org/libs/mpl for documentation.
14 // $Source: /cvsroot/boost/boost/boost/mpl/pair_view.hpp,v $
15 // $Date: 2004/11/28 01:56:21 $
18 #include <boost/mpl/begin_end.hpp>
19 #include <boost/mpl/iterator_category.hpp>
20 #include <boost/mpl/advance.hpp>
21 #include <boost/mpl/distance.hpp>
22 #include <boost/mpl/next_prior.hpp>
23 #include <boost/mpl/deref.hpp>
24 #include <boost/mpl/min_max.hpp>
25 #include <boost/mpl/pair.hpp>
26 #include <boost/mpl/iterator_tags.hpp>
27 #include <boost/mpl/aux_/config/ctps.hpp>
28 #include <boost/mpl/aux_/na_spec.hpp>
30 namespace boost { namespace mpl {
35 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
37 template< typename Iter1, typename Iter2, typename Category >
40 template< typename Category > struct prior_pair_iter
42 template< typename Iter1, typename Iter2 > struct apply
44 typedef typename mpl::prior<Iter1>::type i1_;
45 typedef typename mpl::prior<Iter2>::type i2_;
46 typedef pair_iter<i1_,i2_,Category> type;
50 template<> struct prior_pair_iter<forward_iterator_tag>
52 template< typename Iter1, typename Iter2 > struct apply
54 typedef pair_iter<Iter1,Iter2,forward_iterator_tag> type;
68 typedef aux::pair_iter_tag tag;
69 typedef Category category;
73 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
75 typename deref<Iter1>::type
76 , typename deref<Iter2>::type
79 typedef typename mpl::next<Iter1>::type i1_;
80 typedef typename mpl::next<Iter2>::type i2_;
81 typedef pair_iter<i1_,i2_,Category> next;
83 typedef apply_wrap2< aux::prior_pair_iter<Category>,Iter1,Iter2 >::type prior;
88 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
90 template< typename Iter1, typename Iter2, typename C >
91 struct deref< pair_iter<Iter1,Iter2,C> >
94 typename deref<Iter1>::type
95 , typename deref<Iter2>::type
99 template< typename Iter1, typename Iter2, typename C >
100 struct next< pair_iter<Iter1,Iter2,C> >
102 typedef typename mpl::next<Iter1>::type i1_;
103 typedef typename mpl::next<Iter2>::type i2_;
104 typedef pair_iter<i1_,i2_,C> type;
107 template< typename Iter1, typename Iter2, typename C >
108 struct prior< pair_iter<Iter1,Iter2,C> >
110 typedef typename mpl::prior<Iter1>::type i1_;
111 typedef typename mpl::prior<Iter2>::type i2_;
112 typedef pair_iter<i1_,i2_,C> type;
115 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
118 template<> struct advance_impl<aux::pair_iter_tag>
120 template< typename Iter, typename D > struct apply
122 typedef typename mpl::advance< typename Iter::first,D >::type i1_;
123 typedef typename mpl::advance< typename Iter::second,D >::type i2_;
124 typedef pair_iter<i1_,i2_,typename Iter::category> type;
128 template<> struct distance_impl<aux::pair_iter_tag>
130 template< typename Iter1, typename Iter2 > struct apply
132 // agurt, 10/nov/04: MSVC 6.5 ICE-s on forwarding
133 typedef typename mpl::distance<
134 typename first<Iter1>::type
135 , typename first<Iter2>::type
142 typename BOOST_MPL_AUX_NA_PARAM(Sequence1)
143 , typename BOOST_MPL_AUX_NA_PARAM(Sequence2)
147 typedef nested_begin_end_tag tag;
149 typedef typename begin<Sequence1>::type iter1_;
150 typedef typename begin<Sequence2>::type iter2_;
151 typedef typename min<
152 typename iterator_category<iter1_>::type
153 , typename iterator_category<iter2_>::type
156 typedef pair_iter<iter1_,iter2_,category_> begin;
159 typename end<Sequence1>::type
160 , typename end<Sequence2>::type
165 BOOST_MPL_AUX_NA_SPEC(2, pair_view)
169 #endif // BOOST_MPL_PAIR_VIEW_HPP_INCLUDED