1 | /*=============================================================================
|
---|
2 | Copyright (c) 2003 Joel de Guzman
|
---|
3 | Copyright (c) 2004 Peder Holt
|
---|
4 |
|
---|
5 | Use, modification and distribution is subject to the Boost Software
|
---|
6 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
7 | http://www.boost.org/LICENSE_1_0.txt)
|
---|
8 | ==============================================================================*/
|
---|
9 | #if !defined(FUSION_ALGORITHM_DETAIL_FOR_EACH_IPP)
|
---|
10 | #define FUSION_ALGORITHM_DETAIL_FOR_EACH_IPP
|
---|
11 |
|
---|
12 | #include <boost/mpl/bool.hpp>
|
---|
13 | #include <boost/spirit/fusion/iterator/equal_to.hpp>
|
---|
14 | #include <boost/spirit/fusion/iterator/next.hpp>
|
---|
15 | #include <boost/spirit/fusion/iterator/deref.hpp>
|
---|
16 |
|
---|
17 | namespace boost { namespace fusion { namespace detail
|
---|
18 | {
|
---|
19 | template <typename First, typename Last, typename F>
|
---|
20 | inline void
|
---|
21 | for_each(First const&, Last const&, F const&, mpl::true_)
|
---|
22 | {
|
---|
23 | }
|
---|
24 |
|
---|
25 | template <typename First, typename Last, typename F>
|
---|
26 | inline void
|
---|
27 | for_each(First const& first, Last const& last, F const& f, mpl::false_)
|
---|
28 | {
|
---|
29 | f(*first);
|
---|
30 | detail::for_each(fusion::next(first), last, f
|
---|
31 | , meta::equal_to<BOOST_DEDUCED_TYPENAME meta::next<First>::type, Last>());
|
---|
32 | }
|
---|
33 | }}}
|
---|
34 |
|
---|
35 | #endif
|
---|
36 |
|
---|