2 #ifndef BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
3 #define BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
5 // Copyright Aleksey Gurtovoy 2003-2007
6 // Copyright David Abrahams 2003-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.
18 #include <boost/mpl/set/aux_/set0.hpp>
19 #include <boost/mpl/has_key.hpp>
20 #include <boost/mpl/iterator_tags.hpp>
21 #include <boost/mpl/next.hpp>
22 #include <boost/mpl/eval_if.hpp>
23 #include <boost/mpl/if.hpp>
24 #include <boost/mpl/identity.hpp>
25 #include <boost/mpl/aux_/config/ctps.hpp>
27 namespace boost { namespace mpl {
29 // used by 's_iter_get'
30 template< typename Set, typename Tail > struct s_iter;
32 template< typename Set, typename Tail > struct s_iter_get
34 has_key< Set,typename Tail::item_type_ >
35 , identity< s_iter<Set,Tail> >
36 , next< s_iter<Set,Tail> >
41 template< typename Set, typename Tail > struct s_iter_impl
44 typedef forward_iterator_tag category;
45 typedef typename Tail::item_type_ type;
47 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
48 typedef typename s_iter_get< Set,typename Tail::base >::type next;
52 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
54 template< typename Set, typename Tail >
55 struct next< s_iter<Set,Tail> >
56 : s_iter_get< Set,typename Tail::base >
60 template< typename Set >
61 struct next< s_iter<Set,set0<> > >
63 typedef s_iter<Set,set0<> > type;
66 template< typename Set, typename Tail > struct s_iter
67 : s_iter_impl<Set,Tail>
71 template< typename Set > struct s_iter<Set, set0<> >
73 typedef forward_iterator_tag category;
78 template< typename Set >
81 typedef forward_iterator_tag category;
82 typedef s_iter<Set,set0<> > next;
85 template< typename Set, typename Tail > struct s_iter
87 is_same< Tail,set0<> >
89 , s_iter_impl<Set,Tail>
94 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
98 #endif // BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED