Here\'s some code (full program follows later in the question):
template T fizzbuzz(T n) { T count(0); #if CONST const T d
I'm guessing its just the severely old GCC version you are running. The oldest compiler I have on my machine - gcc-4.1.2, performs the fast way with both the non-const and the wrap versions (and does so at only -O1).