本文整理汇总了C++中std::forward_list::cend方法的典型用法代码示例。如果您正苦于以下问题:C++ forward_list::cend方法的具体用法?C++ forward_list::cend怎么用?C++ forward_list::cend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::forward_list
的用法示例。
在下文中一共展示了forward_list::cend方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
inline int operator () (EArgs&&... args) // O(n)
{
if(slots.empty())
return default_return_value;
auto it = slots.cbegin(), end = slots.cend();
auto prev = slots.cbefore_begin();
while(it != end)
{
try
{
(it->second)(std::forward<EArgs>(args)...);
prev = it;
++it;
}
catch(slot_remove)
{
it = slots.erase_after(prev);
}
catch(signal_return e)
{
return e.get();
}
}
return default_return_value;
}
示例2: runDeferred
void runDeferred(DeferredHandler f) {
__EVENTEMITTER_LOCK_GUARD(mutex);
auto it = deferredQueue.cbegin();
auto prevIt = deferredQueue.cbefore_begin();
for(; it != deferredQueue.cend(); prevIt = it, ++it);
deferredQueue.emplace_after(prevIt, std::move(f));
}
示例3: save
inline void save(
Archive & ar,
const std::forward_list<U, Allocator> &t,
const unsigned int file_version
){
const collection_size_type count(std::distance(t.cbegin(), t.cend()));
boost::serialization::stl::save_collection<
Archive,
std::forward_list<U, Allocator>
>(ar, t, count);
}
示例4: remove_follower
int remove_follower(const std::string& base, const std::string& filter)
{
SteamWorks::Logging::Logger& log = SteamWorks::Logging::getLogger("steamworks.pulley");
log.debugStream() << "Looking for SyncRepl base=" << base << " filter=" << filter;
#ifndef NDEBUG
for(auto it = m_following.cbegin(); it != m_following.cend(); it++)
{
auto& f = *it;
log.debugStream() << " .. SyncRepl @" << (void *)f.get() << " base=" << f->base() << " filter=" << f->filter();
}
#endif
m_following.remove_if([&](const SyncReplUPtr& f) { return (f->base() == base) && (f->filter() == filter); });
return 0;
}
示例5: disconnect
inline bool disconnect(connection_type con) // O(n)
{
auto it = slots.cbegin(), end = slots.cend();
auto prev = slots.cbefore_begin();
while(it != end)
{
if(it == con)
{
slots.erase_after(prev);
return true;
}
prev = it;
++it;
}
return false;
}
示例6: connect
inline connection_type connect(long priority, Slot&& f) // O(n)
{
auto prev = slots.cbefore_begin(),
next = slots.cbegin(),
end = slots.cend();
while(next != end)
{
// <=
if(priority < next->first)
{
return slots.insert_after(prev, std::make_pair(priority, std::move(f)));
}
prev = next;
++next;
}
return slots.insert_after(prev, std::make_pair(priority, std::move(f)));
}
示例7: start
// Wait until a process in the given list has begun. The function checks whether any are running and if none are,
// sleeps for half a second before trying again. If a process is found to be active it will be returned. The wait
// can also be interrupted by a CTRL + SHIFT + END key hit. If that happens, the function returns the end iterator.
std::forward_list<HOOK_TCHARSTR>::const_iterator procWaitLoop(const std::forward_list<HOOK_TCHARSTR> &procList)
{
auto start(procList.cbegin());
auto end(procList.cend());
auto iter(Hook::checkProcessActive(start, end));
while (iter == end)
{
std::this_thread::sleep_for(std::chrono::milliseconds(500));
if (GetAsyncKeyState(VK_CONTROL) && GetAsyncKeyState(VK_END) && GetAsyncKeyState(VK_SHIFT))
{
break;
}
iter = Hook::checkProcessActive(start, end);
}
return iter;
}
示例8: count_followers
unsigned int count_followers()
{
return std::distance(m_following.cbegin(), m_following.cend());
}
示例9: good_emplace_front_forward_list1
void good_emplace_front_forward_list1(std::forward_list<int> &FL, int n) {
auto i0 = FL.cbegin(), i1 = FL.cend();
FL.emplace_front(n);
*i0; // no-warning
}