| Category: algorithms | Component type: function |
template <class BidirectionalIterator> void reverse(BidirectionalIterator first, BidirectionalIterator last);
vector<int> V;
V.push_back(0);
V.push_back(1);
V.push_back(2);
copy(V.begin(), V.end(), ostream_iterator<int>(cout, " "));
// Output: 0 1 2
reverse(V.begin(), V.end());
copy(V.begin(), V.end(), ostream_iterator<int>(cout, " "));
// Output: 2 1 0
| Using this site means you accept its terms of use | privacy policy | | | trademark information |
| Copyright © 1993-2003 Silicon Graphics, Inc. All rights reserved. | | | contact us |