/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/Math/interface/logic.h
13 строк
589 B
Kevin Pedro
inline function
11 апр 2025, 17:51
11 апр 2025, 17:51
5fa9578
Код
Авторство
О чём код?
#ifndef DataFormats_Math_logic_h #define DataFormats_Math_logic_h namespace reco { // this function can be called with any boolean expressions as the parameters // this forces the evaluation of both expressions (faster if the expressions are simple) // and applying && to two bools avoids branching (jump instruction) // whereas applying && to the two original expressions may cause branching // this is an alternative to using the bitwise and operator (&), which never short-circuits inline bool branchless_and(bool a, bool b) { return a && b; } } // namespace reco #endif