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


C++ deque::rend方法代码示例

本文整理汇总了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;
    }
}
开发者ID:arunjalota,项目名称:paperman,代码行数:25,代码来源:PdfPage.cpp

示例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());
}
开发者ID:koreldan,项目名称:utymap,代码行数:8,代码来源:MultipolygonProcessor.cpp

示例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());
	};
开发者ID:Irubataru,项目名称:hopping-large-nt,代码行数:9,代码来源:position_class.hpp

示例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());
}
开发者ID:reinterpretcat,项目名称:utymap,代码行数:12,代码来源:MultipolygonProcessor.cpp

示例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());
}
开发者ID:shikadilord,项目名称:wesnoth,代码行数:16,代码来源:events.cpp

示例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;
}
开发者ID:shikadilord,项目名称:wesnoth,代码行数:17,代码来源:events.cpp


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