本文整理汇总了C++中std::list::reverse方法的典型用法代码示例。如果您正苦于以下问题:C++ list::reverse方法的具体用法?C++ list::reverse怎么用?C++ list::reverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::list
的用法示例。
在下文中一共展示了list::reverse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sortGrasps
/*!
Sorts the grasps in \a grl in quality order from highest to lowest,
and deletes those grasps that have a quality < 0.
*/
void
grasp_tester::orderGraspListByQuality(std::list<plannedGrasp *> &grl) {
if (grl.empty()) {
return;
}
#ifdef WIN32
//the microsoft stl::list<T>.sort algorithm does not work the same
//way as other stl implementations, so we sort by hand.
sortGrasps(grl, grl.begin(), grl.end(), grl.size());
#else
grl.sort(compareGraspQM());
#endif
while ((!grl.empty()) && ((*grl.begin())->get_quality() <= 0.0)) {
delete *(grl.begin());
grl.pop_front();
}
grl.reverse();
#ifdef GRASPITDBG
std::list<plannedGrasp *>::iterator it;
for (it = grl.begin(); it != grl.end(); it++) {
std::cout << "PL_OUT: QM " << (*it)->get_quality() << std::endl;
}
#endif
}
示例2: ExportList
ExportList()
{
data.push_back("/srv/test");
data.push_back("/srv/test/tv");
data.push_back("/");
data.sort();
data.reverse();
}
示例3: run
inline static void run(std::list<T> &c, std::size_t) {
c.reverse();
}