How to get the next prefix in C++?
- by Vicente Botet Escriba
Given a sequence (for example a string "Xa"), I want to get the next prefix in order lexicographic (i.e "Xb").
As I don't want to reinvent the wheel, I'm wondering if there is any function in C++ STL or boost that can help to define this generic function easily?
If not, do you think that this function can be useful?
Notes
The next of "aZ" should be "b".
Even if the examples are strings, the function should work for any Sequence.
The lexicographic order should be a template parameter of the function.