Re:C++11 and Boost - Succinct like Python
by anonymous on Wednesday October 31, 2012 @01:14PM
(#4723943)
In python you can also do
It's still not the same as your example, because in C++ you reverse the string in-place. If you have a mutable array-like, you can do
But to me the syntax with `s[::-1]` is already perfectly clear. There is the difference that `reversed` returns an iterator, while `s[::-1]` constructs a new string.
[ Parent
| on HN ]
There are no comments on this comment yet.