The Sieve of Eratosthenes algorithm in C++