首页 > 代码库 > c++ vector反转reverse

c++ vector反转reverse

[cpp] view plaincopy
  1. template <class BidirectionalIterator>  
  2.   void reverse ( BidirectionalIterator first, BidirectionalIterator last);  

 

[cpp] view plaincopy
  1. 如果不是改变原来的容器,而是翻转之后放在新容器里面,直接用reverse_copy ( BidirectionalIterator first,  
  2.                                 BidirectionalIterator last, OutputIterator result );  

 

[cpp] view plaincopy
    1. std::reverse(trianglePoints.begin(), trianglePoints.end());