and_predicate.hpp

来自「Boost provides free peer-reviewed portab」· HPP 代码 · 共 59 行

HPP
59
字号
/*=============================================================================    Copyright (c) 2001-2007 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(SPIRIT_AND_PREDICATE_MARCH_23_2007_0617PM)#define SPIRIT_AND_PREDICATE_MARCH_23_2007_0617PM#include <boost/spirit/home/support/component.hpp>#include <boost/spirit/home/support/unused.hpp>namespace boost { namespace spirit { namespace qi{    struct and_predicate    {        template <typename Component, typename Context, typename Iterator>        struct attribute        {            typedef unused_type type;        };        template <            typename Component          , typename Iterator, typename Context          , typename Skipper, typename Attribute>        static bool parse(            Component const& component          , Iterator& first, Iterator const& last          , Context& context, Skipper const& skipper          , Attribute& /*attr*/)        {            typedef typename                result_of::subject<Component>::type::director            director;            Iterator i = first;            return director::parse(                subject(component), i, last, context, skipper, unused);        }        template <typename Component, typename Context>        static std::string what(Component const& component, Context const& ctx)        {            std::string result = "and-predicate[";            typedef typename                result_of::subject<Component>::type::director            director;            result += director::what(subject(component), ctx);            result += "]";            return result;        }    };}}}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?