File indexing completed on 2025-01-18 09:34:41
0001
0002
0003
0004
0005
0006
0007 #if !defined(FUSION_ITERATOR_FACADE_09252006_1011)
0008 #define FUSION_ITERATOR_FACADE_09252006_1011
0009
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/support/iterator_base.hpp>
0012 #include <boost/fusion/iterator/detail/advance.hpp>
0013 #include <boost/fusion/iterator/detail/distance.hpp>
0014 #include <boost/fusion/support/category_of.hpp>
0015 #include <boost/type_traits/is_same.hpp>
0016 #include <boost/mpl/assert.hpp>
0017 #include <boost/mpl/if.hpp>
0018
0019 namespace boost { namespace fusion
0020 {
0021 struct iterator_facade_tag;
0022
0023 template <typename Derived, typename Category>
0024 struct iterator_facade : iterator_base<Derived>
0025 {
0026 typedef iterator_facade_tag fusion_tag;
0027 typedef Derived derived_type;
0028 typedef Category category;
0029
0030
0031 template <typename I1, typename I2>
0032 struct equal_to
0033 : is_same<
0034 typename I1::derived_type
0035 , typename I2::derived_type
0036 >
0037 {};
0038
0039
0040 template <typename Iterator, typename N>
0041 struct advance :
0042 mpl::if_c<
0043 (N::value > 0)
0044 , advance_detail::forward<Iterator, N::value>
0045 , advance_detail::backward<Iterator, N::value>
0046 >::type
0047 {
0048 BOOST_MPL_ASSERT_NOT((traits::is_random_access<Iterator>));
0049 };
0050
0051
0052 template <typename First, typename Last>
0053 struct distance :
0054 distance_detail::linear_distance<First, Last>
0055 {};
0056 };
0057 }}
0058
0059 #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
0060 namespace std
0061 {
0062 template <typename Derived, typename Category>
0063 struct iterator_traits< ::boost::fusion::iterator_facade<Derived, Category> >
0064 { };
0065 }
0066 #endif
0067
0068 #endif