/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Utilities/test/likely_t.cpp
36 строк
608 B
Christopher Jones
Renamed likely macro to avoid name collision
24 май 2018, 19:24
24 май 2018, 19:24
8047679
Код
Авторство
О чём код?
#include "FWCore/Utilities/interface/Likely.h" #include <iostream> #include <cassert> // test that compiles and does not interfere with the logic... namespace { bool test(int n) { bool ret=true; if (LIKELY(n>1)) ret&=true; else ret=false; if (UNLIKELY(n>1)) ret&=true; else ret =false; ret &=LIKELY(n>1); ret &=UNLIKELY(n>1); return ret; } } int main() { #ifdef NO_LIKELY std::cout << "NO_LIKELY" << std::endl; #endif #ifdef REVERSE_LIKELY std::cout << "REVERSE_LIKELY" << std::endl; #endif assert(!test(0)); assert(test(2)); return 0; }