forked from boostorg/fusion
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
![]() |
/*=============================================================================
|
||
|
Copyright (c) 2001-2006 Joel de Guzman
|
||
|
Copyright (c) 2005 Eric Niebler
|
||
|
|
||
|
Use, modification and distribution is subject to 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)
|
||
|
==============================================================================*/
|
||
|
#if !defined(FUSION_ANY_05052005_1230)
|
||
|
#define FUSION_ANY_05052005_1230
|
||
|
|
||
|
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||
|
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||
|
#include <boost/fusion/iterator/equal_to.hpp>
|
||
|
#include <boost/fusion/algorithm/query/detail/any.hpp>
|
||
|
|
||
|
namespace boost { namespace fusion
|
||
|
{
|
||
|
namespace result_of
|
||
|
{
|
||
|
template <typename Sequence, typename F>
|
||
|
struct any
|
||
|
{
|
||
|
typedef bool type;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
template <typename Sequence, typename F>
|
||
|
inline bool
|
||
|
any(Sequence const& seq, F f)
|
||
|
{
|
||
|
return detail::any(
|
||
|
fusion::begin(seq)
|
||
|
, fusion::end(seq)
|
||
|
, f
|
||
|
, result_of::equal_to<
|
||
|
typename result_of::begin<Sequence>::type
|
||
|
, typename result_of::end<Sequence>::type>());
|
||
|
}
|
||
|
}}
|
||
|
|
||
|
#endif
|
||
|
|