csp icon indicating copy to clipboard operation
csp copied to clipboard

Switch platform-dependent likely/unlikely macros to use C++20 standard attributes

Open AdamGlustein opened this issue 1 year ago • 0 comments

Now that we have upgraded to C++20, we can use the [[likely]] / [[unlikely]] attributes that are now part of the official standard rather having platform-dependent likely/unlikely macros in https://github.com/Point72/csp/blob/main/cpp/csp/core/Likely.h.

The change however seems pretty tedious since the attribute needs to be at the beginning/ending of the line, i.e. if(x) [[likely]] rather than in the if-statement like if( __builtin_expect( x, 0 ) ). So I think we'd have to make this change manually, we can't just change the macros or use a script for all cases.

AdamGlustein avatar May 21 '24 14:05 AdamGlustein