Switch platform-dependent likely/unlikely macros to use C++20 standard attributes #239
Labels
lang: c++
Issues and PRs related to the C++ codebase
type: enhancement
Issues and PRs related to improvements to existing features
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-dependentlikely/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 likeif( __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.The text was updated successfully, but these errors were encountered: