Lets say I have a function
str_rev(string &s, int len) {}
which reverses the string s of length len
I want to reverse a substring of long string starting at index 5 and of length 10
for this I was forced to first call substring function and then call the str_rev function passing the substring
sub_string = long_str.substr(5, 10)
str_rev(sub_string, 10);
Is there any way to achieve this without actually creating a temporary object?