Update of /cvsroot/boost/boost/boost/xpressive/detail/core/matcher
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12864/detail/core/matcher
Added Files:
predicate_matcher.hpp
Log Message:
add xpressive::if_() for user-defined predicates
--- NEW FILE: predicate_matcher.hpp ---
///////////////////////////////////////////////////////////////////////////////
// predicate_matcher.hpp
//
// Copyright 2004 Eric Niebler. 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)
#ifndef BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_PREDICATE_MATCHER_HPP_EAN_03_22_2007
#define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_PREDICATE_MATCHER_HPP_EAN_03_22_2007
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <boost/xpressive/detail/detail_fwd.hpp>
#include <boost/xpressive/detail/core/quant_style.hpp>
#include <boost/xpressive/detail/core/state.hpp>
namespace boost { namespace xpressive { namespace detail
{
///////////////////////////////////////////////////////////////////////////////
// predicate_matcher
//
template<typename Predicate>
struct predicate_matcher
: quant_style_assertion
{
int sub_;
Predicate predicate_;
predicate_matcher(Predicate const &pred, int sub)
: sub_(sub)
, predicate_(pred)
{
}
template<typename BidiIter, typename Next>
bool match(state_type<BidiIter> &state, Next const &next) const
{
sub_match<BidiIter> const &sub = state.sub_match(this->sub_);
return proto::arg(this->predicate_).pred(sub) && next.match(state);
}
};
}}}
#endif //
BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_PREDICATE_MATCHER_HPP_EAN_03_22_2007
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs