1 ///////////////////////////////////////////////////////////////////////////////
4 // Copyright 2008 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_XPRESSIVE_DETAIL_UTILITY_ANY_HPP_EAN_11_19_2005
9 #define BOOST_XPRESSIVE_DETAIL_UTILITY_ANY_HPP_EAN_11_19_2005
11 #include <boost/version.hpp>
13 #if BOOST_VERSION >= 103300
15 // In Boost 1.33+, we have a cons list in Fusion, so just include it.
17 # if BOOST_VERSION >= 103500
18 # include <boost/fusion/include/any.hpp> // Boost 1.35+ has Fusion2
20 # include <boost/spirit/fusion/algorithm/any.hpp> // Fusion1
25 # include <boost/spirit/fusion/sequence/begin.hpp>
26 # include <boost/spirit/fusion/sequence/end.hpp>
27 # include <boost/spirit/fusion/iterator/equal_to.hpp>
28 # include <boost/mpl/bool.hpp>
29 # include <boost/spirit/fusion/iterator/equal_to.hpp>
30 # include <boost/spirit/fusion/iterator/next.hpp>
31 # include <boost/spirit/fusion/iterator/deref.hpp>
33 namespace boost { namespace fusion
38 template <typename First, typename Last, typename F>
40 any(First const&, Last const&, F const&, mpl::true_)
45 template <typename First, typename Last, typename F>
47 any(First const& first, Last const& last, F const& f, mpl::false_)
51 return detail::any(fusion::next(first), last, f
52 , meta::equal_to<BOOST_DEDUCED_TYPENAME meta::next<First>::type, Last>());
58 template <typename Sequence, typename F>
69 template <typename Sequence, typename F>
75 template <typename Sequence, typename F>
77 operator()(Sequence const& seq, F const& f) const
84 BOOST_DEDUCED_TYPENAME meta::begin<Sequence>::type
85 , BOOST_DEDUCED_TYPENAME meta::end<Sequence>::type>());
88 template <typename Sequence, typename F>
90 operator()(Sequence& seq, F const& f) const
97 BOOST_DEDUCED_TYPENAME meta::begin<Sequence>::type
98 , BOOST_DEDUCED_TYPENAME meta::end<Sequence>::type>());
103 function::any const any = function::any();