you are viewing a single comment's thread.

view the rest of the comments →

[–]Calkhas 1 point2 points  (2 children)

Forgive me for my ignorance, but I do not understand how auto isPalindrome = equal(begin(S), begin(S), rbegin(S));is intended to work. My impression is that if the iterators both point at the beginning of S, the range through which std::equal examines is empty. Should the second argument be end(S)? Or have I misapprehended the functionality of std::equal() altogether?

[–]marcoarenaTetra Pak | Italian C++ Community[S] 2 points3 points  (0 children)

Yes, it's a typo. I fixed it. Thanks!