| Category: algorithms | Component type: function |
template <class ForwardIterator>
inline ForwardIterator rotate(ForwardIterator first, ForwardIterator middle,
ForwardIterator last);
char alpha[] = "abcdefghijklmnopqrstuvwxyz";
rotate(alpha, alpha + 13, alpha + 26);
printf("%s\n", alpha);
// The output is nopqrstuvwxyzabcdefghijklm
[1] It follows from these two requirements that [first, last) is a valid range.
[2] Rotate uses a different algorithm depending on whether its arguments are Forward Iterators, Bidirectional Iterators, or Random Access Iterators. All three algorithms, however, are linear.
| privacy policy | | | contact us |
| Copyright © 1993-2001 Silicon Graphics, Inc. All rights reserved. | | | Trademark Information |