My suggestion is that you save in your class a vector of previously found primes, then check them first against the test value. Also remember that you don't need to test it with primes greater than its square root.
What is "sqrt_int()" for? [edit]( Never mind, I found it )[/edit]