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


C++ forward_list::pop_front方法代码示例

本文整理汇总了C++中std::forward_list::pop_front方法的典型用法代码示例。如果您正苦于以下问题:C++ forward_list::pop_front方法的具体用法?C++ forward_list::pop_front怎么用?C++ forward_list::pop_front使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在std::forward_list的用法示例。


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

示例1: foldr_dest

U foldr_dest(std::function< U (U, T)>& op, const U& val, std::forward_list<T>& L)
{
  if (L.empty()) return U(val);
  T h = L.front();
  L.pop_front();
  return op (foldr(op, val, L),  h);
}
开发者ID:fons,项目名称:presentations,代码行数:7,代码来源:fold.cpp

示例2: get

void get(int k){
	termStack.sort(std::greater<node>());
	for(int i=0; i<k; i++){
		cout<<termStack.front().t<<endl;
		termStack.pop_front();
	}
}
开发者ID:reallistic,项目名称:Puzzle-Solutions,代码行数:7,代码来源:FreqCount+EN.cpp

示例3:

void
TraialPool::return_traials(std::forward_list< Reference< Traial > >& list)
{
	for (auto it = list.begin() ; it != list.end() ; it = list.begin()) {
		available_traials_.push_front(*it);
		list.pop_front();  // 'it' got invalidated
	}
}
开发者ID:raulmonti,项目名称:FIG,代码行数:8,代码来源:TraialPool.cpp

示例4: runDeferred

		bool runDeferred() {
			__EVENTEMITTER_LOCK_GUARD(mutex);
			if(deferredQueue.empty()) {
				return false;
			}
			(deferredQueue.front())();
			deferredQueue.pop_front();
			return true;
		}
开发者ID:Rush,项目名称:cpp-EventEmitter,代码行数:9,代码来源:EventEmitter.sane.hpp

示例5:

static ptid_t
fbsd_next_vfork_done (void)
{
  if (!fbsd_pending_vfork_done.empty ())
    {
      ptid_t ptid = fbsd_pending_vfork_done.front ();
      fbsd_pending_vfork_done.pop_front ();
      return ptid;
    }
  return null_ptid;
}
开发者ID:jon-turney,项目名称:binutils-gdb,代码行数:11,代码来源:fbsd-nat.c

示例6: rReverse

void rReverse(std::forward_list<int> &l){
	
	if(!l.empty()){
		 a = l.front();

		l.pop_front();  //Remove all elements until empty

		rReverse(l); 
	}else{

		l.push_front(a); //Insert elements from the function stack
		
	}
	
}
开发者ID:rand0wn,项目名称:ask-dsa,代码行数:15,代码来源:reverseLL.cpp

示例7: rReturn

//Using recursion
int rReturn(std::forward_list<int> l, int n){

    static int i = 0;

	if(i == n)
 	return l.front();

	if(!l.empty())
		
	{
	int a = l.front();
	
	l.pop_front();

	rReturn(l, n);
	
	l.push_front(a);

	i++;
	
     }
	
}
开发者ID:rand0wn,项目名称:ask-dsa,代码行数:24,代码来源:Nnode.cpp

示例8:

int
exceptions_state_mc_catch (struct gdb_exception *exception,
			   int mask)
{
  *exception = std::move (catchers.front ().exception);
  catchers.pop_front ();

  if (exception->reason < 0)
    {
      if (mask & RETURN_MASK (exception->reason))
	{
	  /* Exit normally and let the caller handle the
	     exception.  */
	  return 1;
	}

      /* The caller didn't request that the event be caught, relay the
	 event to the next exception_catch/CATCH_SJLJ.  */
      throw_exception_sjlj (*exception);
    }

  /* No exception was thrown.  */
  return 0;
}
开发者ID:T-J-Teru,项目名称:binutils-gdb,代码行数:24,代码来源:common-exceptions.c

示例9: pop

 void pop() {
     data_.pop_front();
     mins_.pop_front();
 }
开发者ID:musteryu,项目名称:leetcode,代码行数:4,代码来源:solution.cpp

示例10: bad_pop_front_forward_list1

void bad_pop_front_forward_list1(std::forward_list<int> &FL, int n) {
  auto i1 = FL.cbegin(), i0 = i1++;
  FL.pop_front();
  *i0; // expected-warning{{Invalidated iterator accessed}}
}
开发者ID:LegalizeAdulthood,项目名称:clang,代码行数:5,代码来源:invalidated-iterator.cpp

示例11: good_pop_front_forward_list1

void good_pop_front_forward_list1(std::forward_list<int> &FL, int n) {
  auto i1 = FL.cbegin(), i0 = i1++;
  FL.pop_front();
  *i1; // no-warning
}
开发者ID:LegalizeAdulthood,项目名称:clang,代码行数:5,代码来源:invalidated-iterator.cpp


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