The true lazy erastothenes sieve as described by the famous paper of Melissa E. O’Neill. Check it!
Another important source for this study was the Stepanov 's book on generics.
Nonetheless, the code by O'Neill it's very consistent to the real Erastosthenes sieve demonstrated by the Chapter 3 of Stepanov.
The queue implementaion credits to Jessen Garrisson.