本文整理汇总了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);
}
示例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();
}
}
示例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
}
}
示例4: runDeferred
bool runDeferred() {
__EVENTEMITTER_LOCK_GUARD(mutex);
if(deferredQueue.empty()) {
return false;
}
(deferredQueue.front())();
deferredQueue.pop_front();
return true;
}
示例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;
}
示例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
}
}
示例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++;
}
}
示例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;
}
示例9: pop
void pop() {
data_.pop_front();
mins_.pop_front();
}
示例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}}
}
示例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
}