/usr/include/boost/spirit/home/support/algorithm
Edit: /usr/include/boost/spirit/home/support/algorithm/any_ns_so.hpp (3519B)
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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)
==============================================================================*/
#if !defined(BOOST_SPIRIT_ANY_NS_SO_DECEMBER_03_2017_0826PM)
#define BOOST_SPIRIT_ANY_NS_SO_DECEMBER_03_2017_0826PM
#if defined(_MSC_VER)
#pragma once
#endif
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace spirit
{
// A non-short circuiting (ns) strict order (so) version of the any
// algorithm
namespace detail
{
template
inline bool
any_ns_so(First1 const&, First2 const&, Last const&, F const&, mpl::true_)
{
return false;
}
template
inline bool
any_ns_so(First1 const& first1, First2 const& first2, Last const& last, F& f, mpl::false_)
{
bool head = f(*first1, *first2);
bool tail =
detail::any_ns_so(
fusion::next(first1)
, fusion::next(first2)
, last
, f
, fusion::result_of::equal_to<
typename fusion::result_of::next::type, Last>());
return head || tail;
}
template
inline bool
any_ns_so(First const&, Last const&, F const&, mpl::true_)
{
return false;
}
template
inline bool
any_ns_so(First const& first, Last const& last, F& f, mpl::false_)
{
bool head = f(*first);
bool tail =
detail::any_ns_so(
fusion::next(first)
, last
, f
, fusion::result_of::equal_to<
typename fusion::result_of::next::type, Last>());
return head || tail;
}
}
template
inline bool
any_ns_so(Sequence1 const& seq1, Sequence2& seq2, F f)
{
return detail::any_ns_so(
fusion::begin(seq1)
, fusion::begin(seq2)
, fusion::end(seq1)
, f
, fusion::result_of::equal_to<
typename fusion::result_of::begin::type
, typename fusion::result_of::end::type>());
}
template
inline bool
any_ns_so(Sequence const& seq, unused_type, F f)
{
return detail::any_ns_so(
fusion::begin(seq)
, fusion::end(seq)
, f
, fusion::result_of::equal_to<
typename fusion::result_of::begin::type
, typename fusion::result_of::end::type>());
}
}}
#endif