The correct usage of unlikely macro in multiple conditions

153 views Asked by At

I see many examples using the unlikely macro (not the C++20 attribute) as if( unlikely( server == 0 ) ), but never combining them both as if( unlikely( server == 0 ) || unlikely( client == 0 ) ) or if( unlikely( server == 0 || client == 0 ) ).

Can I need to use two unlikely on two conditionals for the same if or the unlikely is interpreted correctly if used only once in the whole if condition as in if( unlikely( server == 0 || client == 0 ) )?

Other questions about unlikely:

  1. gcc likely unlikely macro usage
  2. efficient, extremely-unlikely conditionals?
  3. likely and unlikely macros
  4. likely/unlikely instead of if/else
0

There are 0 answers