basic_string::rendは、逆順イテレータにおける文字列の末尾の次、つまり先頭よりさらに前を返す。
basic_string::rend - cpprefjp C++日本語リファレンス
basic_string.cppで、
こう書く。
basic_string::rendは逆順末尾の次なので、デクリメントして逆順末尾に戻す.
逆順末尾は、つまるところ先頭である。
![こうなる。](https://cdn-ak.f.st-hatena.com/images/fotolife/B/BG1/20231123/20231123135157.png)
こうなる。
Sample/cpp/basic_string/rend/src/basic_string at master · bg1bgst333/Sample · GitHub