1*f4e8fbc5SAlexander Shaposhnikov // Prevents the compiler from optimizing everything away. 2*f4e8fbc5SAlexander Shaposhnikov template <class T> void DoNotOptimize(const T &var) { 3*f4e8fbc5SAlexander Shaposhnikov asm volatile("" : "+m"(const_cast<T &>(var))); 4*f4e8fbc5SAlexander Shaposhnikov } 5