当前位置: 首页>>代码示例>>C++>>正文


C++ Next类代码示例

本文整理汇总了C++中Next的典型用法代码示例。如果您正苦于以下问题:C++ Next类的具体用法?C++ Next怎么用?C++ Next使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Next类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            if(state.eos())
            {
                return false;
            }

            char_type ch = *state.cur_;
            if(traits_cast<Traits>(state).isctype(ch, this->newline_))
            {
                ++state.cur_;
                if(this->cr_ == ch && !state.eos() && this->nl_ == *state.cur_)
                {
                    ++state.cur_;
                    if(next.match(state))
                    {
                        return true;
                    }
                    --state.cur_;
                }
                else if(next.match(state))
                {
                    return true;
                }

                --state.cur_;
            }
            return false;
        }
开发者ID:rogerclark,项目名称:grumble,代码行数:29,代码来源:logical_newline_matcher.hpp

示例2: match_

        bool match_(match_state<BidiIter> &state, Next const &next, mpl::false_) const
        {
            typedef typename iterator_difference<BidiIter>::type difference_type;
            BidiIter const tmp = state.cur_;
            if(!detail::advance_to(state.cur_, -static_cast<difference_type>(this->width_), state.begin_))
            {
                state.cur_ = tmp;
                return this->not_ ? next.match(state) : false;
            }

            // matching xpr could produce side-effects, save state
            memento<BidiIter> mem = save_sub_matches(state);

            if(this->not_)
            {
                // negative look-ahead assertions do not trigger partial matches.
                save_restore<bool> partial_match(state.found_partial_match_);
                detail::ignore_unused(partial_match);

                if(this->xpr_.match(state))
                {
                    restore_action_queue(mem, state);
                    restore_sub_matches(mem, state);
                    BOOST_ASSERT(state.cur_ == tmp);
                    return false;
                }
                state.cur_ = tmp;
                restore_action_queue(mem, state);
                if(next.match(state))
                {
                    reclaim_sub_matches(mem, state, true);
                    return true;
                }
                reclaim_sub_matches(mem, state, false);
            }
            else
            {
                if(!this->xpr_.match(state))
                {
                    state.cur_ = tmp;
                    restore_action_queue(mem, state);
                    reclaim_sub_matches(mem, state, false);
                    return false;
                }
                BOOST_ASSERT(state.cur_ == tmp);
                restore_action_queue(mem, state);
                if(next.match(state))
                {
                    reclaim_sub_matches(mem, state, true);
                    return true;
                }
                restore_sub_matches(mem, state);
            }

            BOOST_ASSERT(state.cur_ == tmp);
            return false;
        }
开发者ID:03050903,项目名称:turbulenz_engine,代码行数:57,代码来源:lookbehind_matcher.hpp

示例3: match_

        bool match_(match_state<BidiIter> &state, Next const &next, mpl::false_) const
        {
            BidiIter const tmp = state.cur_;

            // matching xpr could produce side-effects, save state
            memento<BidiIter> mem = save_sub_matches(state);

            if(this->not_)
            {
                // negative look-ahead assertions do not trigger partial matches.
                save_restore<bool> partial_match(state.found_partial_match_);
                detail::ignore_unused(partial_match);

                if(this->xpr_.match(state))
                {
                    restore_action_queue(mem, state);
                    restore_sub_matches(mem, state);
                    state.cur_ = tmp;
                    return false;
                }
                restore_action_queue(mem, state);
                if(next.match(state))
                {
                    reclaim_sub_matches(mem, state, true);
                    return true;
                }
                reclaim_sub_matches(mem, state, false);
            }
            else
            {
                if(!this->xpr_.match(state))
                {
                    restore_action_queue(mem, state);
                    reclaim_sub_matches(mem, state, false);
                    return false;
                }
                state.cur_ = tmp;
                restore_action_queue(mem, state);
                if(next.match(state))
                {
                    reclaim_sub_matches(mem, state, true);
                    return true;
                }
                restore_sub_matches(mem, state);
            }

            BOOST_ASSERT(state.cur_ == tmp);
            return false;
        }
开发者ID:CasparCG,项目名称:Client,代码行数:49,代码来源:lookahead_matcher.hpp

示例4: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            BOOST_ASSERT(this->mark_number_ < static_cast<int>(state.mark_count_));
            sub_match_impl<BidiIter> const &br = state.sub_match(this->mark_number_);

            if(!br.matched)
            {
                return false;
            }

            BidiIter const tmp = state.cur_;
            for(BidiIter begin = br.first, end = br.second; begin != end; ++begin, ++state.cur_)
            {
                if(state.eos()
                    || detail::translate(*state.cur_, traits_cast<Traits>(state), icase_type())
                    != detail::translate(*begin, traits_cast<Traits>(state), icase_type()))
                {
                    state.cur_ = tmp;
                    return false;
                }
            }

            if(next.match(state))
            {
                return true;
            }

            state.cur_ = tmp;
            return false;
        }
开发者ID:GDXN,项目名称:fitsliberator,代码行数:30,代码来源:mark_matcher.hpp

示例5: match_

        bool match_(match_state<BidiIter> &state, Next const &next, non_greedy_tag) const
        {
            BOOST_ASSERT(!this->leading_);
            BidiIter const tmp = state.cur_;
            unsigned int matches = 0;

            for(; matches < this->min_; ++matches)
            {
                if(!this->xpr_.match(state))
                {
                    state.cur_ = tmp;
                    return false;
                }
            }

            do
            {
                if(next.match(state))
                {
                    return true;
                }
            }
            while(matches++ < this->max_ && this->xpr_.match(state));

            state.cur_ = tmp;
            return false;
        }
开发者ID:03050903,项目名称:turbulenz_engine,代码行数:27,代码来源:simple_repeat_matcher.hpp

示例6: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            if(state.bos())
            {
                if(!state.flags_.match_bol_)
                {
                    return false;
                }
            }
            else
            {
                char_type ch = *boost::prior(state.cur_);

                // If the previous character is not a newline, we're not at the start of a line
                if(!traits_cast<Traits>(state).isctype(ch, this->newline_))
                {
                    return false;
                }
                // There is no line-break between \r and \n
                else if(ch == this->cr_ && !state.eos() && *state.cur_ == this->nl_)
                {
                    return false;
                }
            }

            return next.match(state);
        }
开发者ID:BioinformaticsArchive,项目名称:MulRFRepo,代码行数:27,代码来源:assert_bol_matcher.hpp

示例7: search

static void search( Field &field, Next &next, int level, int lim ){
	const Tumo TUMO = next.get(level);
	const int  LOOP = (TUMO.first==TUMO.second) ? 11 : 22; // 同色なら半分
	for( int i=0; i<LOOP; ++i ){
		// 1手置いた新しいフィールドの作成
		Field      new_field = field;
		const Plan PLAN      = getPlan(i);
		if( setTumo( new_field, TUMO, PLAN ) == -1 ) continue;
		// 初手をメモる
		if( level==0 ) plan_first = PLAN;
		// 発火する
		InfoFire info;
		fireField( new_field, info );
		// 窒息確認
		if( new_field.get(3,12)!=BRANK ) continue;
		// フィールドを評価して過去最高ならメモ
		int score = eval_field( new_field, next ); // フィールド形の評価
		if( score>max_score ){
			max_score = score;
			plan_best = plan_first;
		}
		// さらなる深みへ
		if( level<lim ) search( new_field, next, level+1, lim );
	}	
}
开发者ID:REF3000,项目名称:PuyoSimulator,代码行数:25,代码来源:AI_debug.cpp

示例8: match

        bool match(match_state<BidiIter> &state, Next const &next) const
        {
            BidiIter cur = state.cur_;
            bool const thisword = !state.eos() && this->is_word(traits_cast<Traits>(state), *cur);
            bool const prevword = (!state.bos() || state.flags_.match_prev_avail_)
                && this->is_word(traits_cast<Traits>(state), *--cur);

            return Cond::eval(prevword, thisword, state) && next.match(state);
        }
开发者ID:03050903,项目名称:turbulenz_engine,代码行数:9,代码来源:assert_word_matcher.hpp

示例9: match_

        bool match_(match_state<BidiIter> &state, Next const &next, mpl::true_) const
        {
            sub_match_impl<BidiIter> &br = state.sub_match(this->mark_number_);

            if(this->max_ > br.repeat_count_)
            {
                ++br.repeat_count_;
                // loop back to the expression "pushed" in repeat_begin_matcher::match
                if(next.top_match(state, this->back_))
                {
                    return true;
                }
                else if(--br.repeat_count_ < this->min_)
                {
                    return false;
                }
            }

            // looping finished, continue matching the rest of the pattern
            return next.skip_match(state);
        }
开发者ID:rogerclark,项目名称:grumble,代码行数:21,代码来源:repeat_end_matcher.hpp

示例10: match

        static bool match(match_state<BidiIter> &state, Next const &next)
        {
            attr_context old_attr_context = state.attr_context_;
            state.attr_context_ = *old_attr_context.prev_attr_context_;

            if(next.match(state))
            {
                return true;
            }

            state.attr_context_ = old_attr_context;
            return false;
        }
开发者ID:13W,项目名称:icq-desktop,代码行数:13,代码来源:attr_end_matcher.hpp

示例11: match

    bool match(match_state<BidiIter> &state, Next const &next) const
    {
        if(state.eos() || this->not_ == this->in_set(traits_cast<Traits>(state), *state.cur_))
        {
            return false;
        }

        if(++state.cur_, next.match(state))
        {
            return true;
        }

        return --state.cur_, false;
    }
开发者ID:rogerclark,项目名称:grumble,代码行数:14,代码来源:set_matcher.hpp

示例12: match

        bool match(state_type<BidiIter> &state, Next const &next) const
        {
            sub_match_impl<BidiIter> &br = state.sub_match(this->mark_number_);

            BidiIter old_begin = br.begin_;
            br.begin_ = state.cur_;

            if(next.match(state))
            {
                return true;
            }

            br.begin_ = old_begin;
            return false;
        }
开发者ID:AlexS2172,项目名称:IVRM,代码行数:15,代码来源:mark_begin_matcher.hpp

示例13: match_next

    inline bool match_next(match_state<BidiIter> &state, Next const &next, int mark_number)
    {
        sub_match_impl<BidiIter> &br = state.sub_match(mark_number);

        bool old_matched = br.matched;
        br.matched = false;

        if(next.match(state))
        {
            return true;
        }

        br.matched = old_matched;
        return false;
    }
开发者ID:GDXN,项目名称:fitsliberator,代码行数:15,代码来源:optional_matcher.hpp

示例14: match

        bool match(state_type<BidiIter> &state, Next const &next) const
        {
            if(state.eos() || !this->charset_.test(*state.cur_, traits_cast<Traits>(state), icase_type()))
            {
                return false;
            }

            ++state.cur_;
            if(next.match(state))
            {
                return true;
            }

            --state.cur_;
            return false;
        }
开发者ID:AlexS2172,项目名称:IVRM,代码行数:16,代码来源:charset_matcher.hpp

示例15: match

        static bool match(state_type<BidiIter> &state, Next const &next)
        {
            if(state.eos())
            {
                return false;
            }

            ++state.cur_;
            if(next.match(state))
            {
                return true;
            }

            --state.cur_;
            return false;
        }
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:16,代码来源:any_matcher.hpp


注:本文中的Next类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。