2006-08-16 16:50:52 +00:00
|
|
|
/*=============================================================================
|
|
|
|
Copyright (c) 2001-2006 Joel de Guzman
|
|
|
|
Copyright (c) 2005 Eric Niebler
|
|
|
|
|
2007-03-02 10:44:14 +00:00
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
2006-08-16 16:50:52 +00:00
|
|
|
==============================================================================*/
|
|
|
|
#if !defined(FUSION_ANY_05052005_1229)
|
|
|
|
#define FUSION_ANY_05052005_1229
|
|
|
|
|
|
|
|
#include <boost/mpl/bool.hpp>
|
|
|
|
#include <boost/fusion/iterator/equal_to.hpp>
|
|
|
|
#include <boost/fusion/iterator/next.hpp>
|
|
|
|
#include <boost/fusion/iterator/deref.hpp>
|
|
|
|
|
|
|
|
namespace boost { namespace fusion { namespace detail
|
|
|
|
{
|
|
|
|
template <typename First, typename Last, typename F>
|
|
|
|
inline bool
|
|
|
|
any(First const&, Last const&, F const&, mpl::true_)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename First, typename Last, typename F>
|
|
|
|
inline bool
|
|
|
|
any(First const& first, Last const& last, F& f, mpl::false_)
|
|
|
|
{
|
|
|
|
typename result_of::deref<First>::type x = *first;
|
|
|
|
return f(x) ||
|
|
|
|
detail::any(
|
|
|
|
fusion::next(first)
|
|
|
|
, last
|
|
|
|
, f
|
|
|
|
, result_of::equal_to<typename result_of::next<First>::type, Last>());
|
|
|
|
}
|
|
|
|
}}}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|