x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
predicate_matcher.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\xpressive\detail\core\matcher\predicate_matcher.hpp
Girar
Efecto
Propiedad
Historial
/////////////////////////////////////////////////////////////////////////////// // predicate_matcher.hpp // // Copyright 2007 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
#include
#include
#include
#include
#include
#include
namespace boost { namespace xpressive { namespace detail { /////////////////////////////////////////////////////////////////////////////// // predicate_context // template
struct predicate_context { explicit predicate_context(int sub, sub_match_impl
const *sub_matches) : sub_(sub) , sub_matches_(sub_matches) {} // eval_terminal template
struct eval_terminal : proto::default_eval
{}; template
struct eval_terminal
> { typedef Arg &result_type; result_type operator()(Expr &expr, predicate_context const &) const { return proto::arg(expr).get(); } }; template
struct eval_terminal
{ typedef sub_match
const &result_type; result_type operator()(Expr &, predicate_context const &ctx) const { return ctx.sub_matches_[ctx.sub_]; } }; template
struct eval_terminal
{ typedef sub_match
const &result_type; result_type operator()(Expr &expr, predicate_context const &ctx) const { return ctx.sub_matches_[proto::arg(expr).mark_number_]; } }; // eval template
struct eval : proto::default_eval
{}; template
struct eval
: eval_terminal
::type> {}; #if BOOST_VERSION >= 103500 template
struct eval
: mem_ptr_eval
{}; #endif int sub_; sub_match_impl
const *sub_matches_; }; /////////////////////////////////////////////////////////////////////////////// // AssertionFunctor // struct AssertionFunctor : proto::function< proto::terminal
, proto::terminal
> {}; /////////////////////////////////////////////////////////////////////////////// // predicate_matcher // template
struct predicate_matcher : quant_style_assertion { int sub_; Predicate predicate_; predicate_matcher(Predicate const &pred, int sub) : sub_(sub) , predicate_(pred) { } template
bool match(match_state
&state, Next const &next) const { // Predicate is check(assertion), where assertion can be // a lambda or a function object. return this->match_(state, next, proto::matches
()); } private: template
bool match_(match_state
&state, Next const &next, mpl::true_) const { sub_match
const &sub = state.sub_match(this->sub_); return proto::arg(proto::arg_c<1>(this->predicate_))(sub) && next.match(state); } template
bool match_(match_state
&state, Next const &next, mpl::false_) const { predicate_context
ctx(this->sub_, state.sub_matches_); return proto::eval(proto::arg_c<1>(this->predicate_), ctx) && next.match(state); } }; }}} #endif // BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_PREDICATE_MATCHER_HPP_EAN_03_22_2007
predicate_matcher.hpp
Dirección de la página
Dirección del archivo
Anterior
27/36
Siguiente
Descargar
( 4 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.