I was going through this blog which explains how to check whether a number is prime or not in O(1) runtime complexity.

In the comments I found a piece of code which compares the time taken to check for prime numbers using the conventional runtime sieve and the explained compile-time evaluated sieve.

My doubt lies in the slow_is_prime() function on line no. 31.

What does the statement: `(Sieve<MAXN>{}).is_prime[n]`

mean?

I understand that `MAXN`

is the parameter passed to the `Sieve`

struct, which is what we would have done while creating a variable of its type as well, but what significance does the `{}`

braces have?

How is it different from:

` Sieve<MAXN> a;`

`return a.is_prime[n];`

?

Also, if you tweak the code a little bit and rather than what is given, if you replace the contents of the slow_is_prime function with:

` Sieve<MAXN> a;`

`return a.is_prime[n];`

there is a considerable difference in the runtimes.

I would be grateful to know your views and/or inputs.