Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:44

0001 
0002 #ifndef BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
0003 #define BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2003-2007
0006 // Copyright David Abrahams 2003-2004
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. 
0009 // (See accompanying file LICENSE_1_0.txt or copy at 
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // See http://www.boost.org/libs/mpl for documentation.
0013 
0014 // $Id$
0015 // $Date$
0016 // $Revision$
0017 
0018 #include <boost/mpl/set/aux_/set0.hpp>
0019 #include <boost/mpl/has_key.hpp>
0020 #include <boost/mpl/iterator_tags.hpp>
0021 #include <boost/mpl/next.hpp>
0022 #include <boost/mpl/eval_if.hpp>
0023 #include <boost/mpl/if.hpp>
0024 #include <boost/mpl/identity.hpp>
0025 #include <boost/mpl/aux_/config/ctps.hpp>
0026 
0027 namespace boost { namespace mpl {
0028 
0029 // used by 's_iter_get'
0030 template< typename Set, typename Tail > struct s_iter;
0031 
0032 template< typename Set, typename Tail > struct s_iter_get
0033     : eval_if< 
0034           has_key< Set,typename Tail::item_type_ >
0035         , identity< s_iter<Set,Tail> >
0036         , next< s_iter<Set,Tail> >
0037         >
0038 {
0039 };
0040 
0041 template< typename Set, typename Tail > struct s_iter_impl
0042 {
0043     typedef Tail                        tail_;
0044     typedef forward_iterator_tag        category;
0045     typedef typename Tail::item_type_   type;
0046 
0047 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0048     typedef typename s_iter_get< Set,typename Tail::base >::type next;
0049 #endif
0050 };
0051 
0052 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0053 
0054 template< typename Set, typename Tail > 
0055 struct next< s_iter<Set,Tail> >
0056     : s_iter_get< Set,typename Tail::base >
0057 {
0058 };
0059 
0060 template< typename Set > 
0061 struct next< s_iter<Set,set0<> > >
0062 {
0063     typedef s_iter<Set,set0<> > type;
0064 };
0065 
0066 template< typename Set, typename Tail > struct s_iter
0067     : s_iter_impl<Set,Tail>
0068 {
0069 };
0070 
0071 template< typename Set > struct s_iter<Set, set0<> >
0072 {
0073     typedef forward_iterator_tag category;
0074 };
0075 
0076 #else
0077 
0078 template< typename Set >
0079 struct s_end_iter
0080 {
0081     typedef forward_iterator_tag    category;
0082     typedef s_iter<Set,set0<> >     next;
0083 };
0084 
0085 template< typename Set, typename Tail > struct s_iter
0086     : if_< 
0087           is_same< Tail,set0<> >
0088         , s_end_iter<Set>
0089         , s_iter_impl<Set,Tail>
0090         >::type
0091 {
0092 };
0093 
0094 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
0095 
0096 }}
0097 
0098 #endif // BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED