// Prevents the compiler from optimizing everything away. template void DoNotOptimize(const T &var) { asm volatile("" : "+m"(const_cast(var))); }