A substring denoted by two std::string::reverse_iterators, how can I copy them out and assign to a new string with normal sequence, not reversely?
One senario may be: A string of "Hello world-John", probe from tail and meet '-' using:
std::string::reverse_iterator rIter
= std::find(str.rbegin(), str.rend(), isDelimiterFunc);
And the rIter is pointing at '-'. I want to get the "John" out, but if I do:
std::string out(str.rbegin(), rIter - 1);
I will got "nhoj".
Thanks guys!