本文整理汇总了C++中std::deque::rend方法的典型用法代码示例。如果您正苦于以下问题:C++ deque::rend方法的具体用法?C++ deque::rend怎么用?C++ deque::rend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::deque
的用法示例。
在下文中一共展示了deque::rend方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PdfElement
PdfPage::PdfPage( PdfObject* pObject, const std::deque<PdfObject*> & rListOfParents )
: PdfElement( "Page", pObject ), PdfCanvas()
{
m_pResources = m_pObject->GetIndirectKey( "Resources" );
if( !m_pResources )
{
// Resources might be inherited
std::deque<PdfObject*>::const_reverse_iterator it = rListOfParents.rbegin();
while( it != rListOfParents.rend() && !m_pResources )
{
m_pResources = (*it)->GetIndirectKey( "Resources" );
++it;
}
}
PdfObject* pContents = m_pObject->GetIndirectKey( "Contents" );
if (pContents)
m_pContents = new PdfContents( pContents );
else
{
// TODO: handle absent contents
m_pContents = NULL;
}
}
示例2: insertCoordinates
void MultipolygonProcessor::insertCoordinates(const std::deque<GeoCoordinate>& source, std::vector<GeoCoordinate>& destination, bool isOuter) const
{
bool isClockwise = utymap::utils::isClockwise(source);
if ((isOuter && isClockwise) || (!isOuter && !isClockwise))
destination.insert(destination.end(), source.begin(), source.end());
else
destination.insert(destination.end(), source.rbegin(), source.rend());
}
示例3: deleteTrailingZeros
void deleteTrailingZeros()
{
auto reverse_it = std::find_if(
pos_vec.rbegin(),
pos_vec.rend(),
[](int i) {return i != 0;} );
pos_vec.erase(reverse_it.base(),pos_vec.end());
};
示例4: insertCoordinates
void MultipolygonProcessor::insertCoordinates(const std::deque<GeoCoordinate> &source,
std::vector<GeoCoordinate> &destination,
bool isOuter) {
// NOTE we need to remove the last coordinate in area
std::size_t offset = source[0]==source[source.size() - 1] ? 1 : 0;
bool isClockwise = utymap::utils::isClockwise(source);
if ((isOuter && !isClockwise) || (!isOuter && isClockwise))
destination.insert(destination.end(), source.begin(), source.end() - offset);
else
destination.insert(destination.end(), source.rbegin() + offset, source.rend());
}
示例5: join_same
void sdl_handler::join_same(sdl_handler* parent)
{
if(has_joined_) {
leave(); // should not be in multiple event contexts
}
for(std::deque<context>::reverse_iterator i = event_contexts.rbegin(); i != event_contexts.rend(); ++i) {
handler_list& handlers = (*i).handlers;
if (std::find(handlers.begin(), handlers.end(), parent) != handlers.end()) {
join(*i);
return;
}
}
join(event_contexts.back());
}
示例6: leave
void sdl_handler::leave()
{
sdl_handler_vector members = handler_members();
if(!members.empty()) {
for(sdl_handler_vector::iterator i = members.begin(); i != members.end(); ++i) {
(*i)->leave();
}
} else {
assert(event_contexts.empty() == false);
}
for(std::deque<context>::reverse_iterator i = event_contexts.rbegin(); i != event_contexts.rend(); ++i) {
if(i->remove_handler(this)) {
break;
}
}
has_joined_ = false;
}