1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_ITERATOR_FACADE_09252006_1011)
8 #define FUSION_ITERATOR_FACADE_09252006_1011
10 #include <boost/fusion/support/iterator_base.hpp>
11 #include <boost/fusion/iterator/detail/advance.hpp>
12 #include <boost/fusion/iterator/detail/distance.hpp>
13 #include <boost/fusion/support/category_of.hpp>
14 #include <boost/type_traits/is_same.hpp>
15 #include <boost/mpl/assert.hpp>
17 namespace boost
{ namespace fusion
19 struct iterator_facade_tag
;
21 template <typename Derived
, typename Category
>
22 struct iterator_facade
: iterator_base
<Derived
>
24 typedef iterator_facade_tag fusion_tag
;
25 typedef Derived derived_type
;
26 typedef Category category
;
28 // default implementation
29 template <typename I1
, typename I2
>
30 struct equal_to
// default implementation
32 typename
I1::derived_type
33 , typename
I2::derived_type
37 // default implementation
38 template <typename Iterator
, typename N
>
42 , advance_detail::forward
<Iterator
, N::value
>
43 , advance_detail::backward
<Iterator
, N::value
>
46 BOOST_MPL_ASSERT_NOT((traits::is_random_access
<Iterator
>));
49 // default implementation
50 template <typename First
, typename Last
>
52 distance_detail::linear_distance
<First
, Last
>