Reverse int within the 32-bit signed integer range
General comments


There is no reason to use a class. Instead, the functionality should be made into a free function.
Your code is overly complicated. There is no reason to make new string from which you erase characters one-by-one. Instead, you can convert the input integer to a string and use a standard function to reverse that.
Also, pay attention to const correctness. This protects from unintended mistakes and helps the compiler optimize more.


I would simplify your function to just:

int reverse(int i) 
{
    try
    {
        auto reversed{ std::to_string(i) };
        std::reverse(reversed.begin(), reversed.end());

        const auto result{ std::stoi(reversed) };
        return i &lt; 0 ? -1 * result : result;
    }
    catch (const std::out_of_range&amp; e) 
    {
        return 0;
    }
}


Further comments


If you want to have a fast solution, you should avoid std::string altogether. This you can do by "iterating" through the digits using arithmetic operations (division and modulus), as in (using std::string to only show you what is happening):

int x = 1234;
std::string s;

while (x &gt; 0)
{
    s.push_back('0' + (x % 10));
    x /= 10;
}

std::cout &lt;&lt; s &lt;&lt; "\n"; // Prints 4321


I will let you take it from here to use these ideas to make your program even faster.
Regarding your theoretical question concerning complexity, if we assume that the input is treated as a string of n characters, there is \$\Omega(n)\$ lower bound by a trivial adversary argument. Basically, if you don't spend at least n time, you can't read the whole of the input, and then you cannot guarantee correct output on every instance.