Calculating primes: Could this be any faster?
There are some optimizations that can make your code better, even with compiler optimizations turned on:
Pre-allocate the vector and treat it like an array.
Use a variable to keep track of the length.
Putting these together, I found about a 10% increase in speed:
vector&lt;int&gt; primes(size_t nb_primes)
{
    vector&lt;int&gt; p(nb_primes,2);
    int n = 2;
    size_t len_p = 0;
    while (len_p &lt; nb_primes)
    {
        bool other = true;
        for (size_t i = 0; i &lt; len_p; i++)
        {
            if (n % p[i] == 0)
            {
                other = false;
                break;
            }
        }
        if (other)
            p[len_p++] = n;
        n += 1;
    }
    return p;
}