• + 2 comments

    void std::reverse<class Iterator>(Iterator begin, Iterator end) is an in-place iterator-based swap and overkill because it makes sense only in one of the two contexts:

    1. string s1 = to_string(x); string s2 = s1 /* copy */; reverse(s2.begin(), s2.end()); if (s1 == s2) ...

    2. as above but you use a function that converts an int to a vector<int> where each element is a digit then do the same process as with the strings

    Both are horrendous overkill compared to the multiply-modulo-add-divide loops in other answers.