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.
Contact Us | Site Map | Trademarks | Privacy | Using this site means you accept its Terms of Use |
Copyright © 2009 - 2014 Silicon Graphics International. All rights reserved. |