News for hackers. Stuff that matters.
Re:C++11 and Boost - Succinct like Python by anonymous on Wednesday October 31, 2012 @01:14PM (#4723943)
In python you can also do

  ''.join(reversed(s))
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

  arrayish[:] = reversed(arrayish)
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.

There are no comments on this comment yet.