File indexing completed on 2025-01-18 09:33:20
0001
0002
0003
0004
0005
0006
0007
0008 #if !defined(FUSION_CONS_ITERATOR_07172005_0849)
0009 #define FUSION_CONS_ITERATOR_07172005_0849
0010
0011 #include <boost/fusion/support/config.hpp>
0012 #include <boost/type_traits/add_const.hpp>
0013 #include <boost/fusion/support/iterator_base.hpp>
0014 #include <boost/fusion/container/list/detail/deref_impl.hpp>
0015 #include <boost/fusion/container/list/detail/next_impl.hpp>
0016 #include <boost/fusion/container/list/detail/value_of_impl.hpp>
0017 #include <boost/fusion/container/list/detail/equal_to_impl.hpp>
0018 #include <boost/fusion/container/list/list_fwd.hpp>
0019
0020 namespace boost { namespace fusion
0021 {
0022 struct nil_;
0023 struct cons_iterator_tag;
0024 struct forward_traversal_tag;
0025
0026 template <typename Cons>
0027 struct cons_iterator_identity;
0028
0029 #ifdef _MSC_VER
0030 # pragma warning(push)
0031 # pragma warning(disable: 4512)
0032 #endif
0033 template <typename Cons = nil_>
0034 struct cons_iterator : iterator_base<cons_iterator<Cons> >
0035 {
0036 typedef cons_iterator_tag fusion_tag;
0037 typedef forward_traversal_tag category;
0038 typedef Cons cons_type;
0039 typedef cons_iterator_identity<
0040 typename add_const<Cons>::type>
0041 identity;
0042
0043 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0044 explicit cons_iterator(cons_type& in_cons) BOOST_NOEXCEPT
0045 : cons(in_cons) {}
0046
0047 cons_type& cons;
0048 };
0049 #ifdef _MSC_VER
0050 # pragma warning(pop)
0051 #endif
0052
0053 struct nil_iterator : iterator_base<nil_iterator>
0054 {
0055 typedef forward_traversal_tag category;
0056 typedef cons_iterator_tag fusion_tag;
0057 typedef nil_ cons_type;
0058 typedef cons_iterator_identity<
0059 add_const<nil_>::type>
0060 identity;
0061
0062 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0063 nil_iterator() BOOST_NOEXCEPT {}
0064 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0065 explicit nil_iterator(nil_ const&) BOOST_NOEXCEPT {}
0066 };
0067
0068 template <>
0069 struct cons_iterator<nil_> : nil_iterator
0070 {
0071 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0072 cons_iterator() BOOST_NOEXCEPT {}
0073 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0074 explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {}
0075 };
0076
0077 template <>
0078 struct cons_iterator<nil_ const> : nil_iterator
0079 {
0080 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0081 cons_iterator() BOOST_NOEXCEPT {}
0082 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0083 explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {}
0084 };
0085
0086 template <>
0087 struct cons_iterator<list<> > : nil_iterator
0088 {
0089 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0090 cons_iterator() BOOST_NOEXCEPT {}
0091 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0092 explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {}
0093 };
0094
0095 template <>
0096 struct cons_iterator<list<> const> : nil_iterator
0097 {
0098 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0099 cons_iterator() BOOST_NOEXCEPT {}
0100 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0101 explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {}
0102 };
0103 }}
0104
0105 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
0106 namespace std
0107 {
0108 template <typename Cons>
0109 struct iterator_traits< ::boost::fusion::cons_iterator<Cons> >
0110 { };
0111 }
0112 #endif
0113
0114 #endif