Reverse a string in C++ with string(name.rbegin(),name.rend()); :     string is = "text";
    string(is.rbegin(),is.rend());

I have found this method for reversing a string but I don't understand how it works. Can you provide me with an explanation? 