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