forked from boostorg/fusion
Initial move from Spirit CVS
[SVN r34896]
This commit is contained in:
42
include/boost/fusion/algorithm/query/all.hpp
Normal file
42
include/boost/fusion/algorithm/query/all.hpp
Normal file
@ -0,0 +1,42 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
|
||||
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_ALL_05052005_1238)
|
||||
#define FUSION_ALL_05052005_1238
|
||||
|
||||
#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/all.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace result_of
|
||||
{
|
||||
template <typename Sequence, typename F>
|
||||
struct all
|
||||
{
|
||||
typedef bool type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename Sequence, typename F>
|
||||
inline bool
|
||||
all(Sequence const& seq, F f)
|
||||
{
|
||||
return detail::all(
|
||||
fusion::begin(seq)
|
||||
, fusion::end(seq)
|
||||
, f
|
||||
, result_of::equal_to<
|
||||
typename result_of::begin<Sequence>::type
|
||||
, typename result_of::end<Sequence>::type>());
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user