C++ Likely and Unlikely attributes

What and Why ?

C likely and unlikely attributes came into existence with the release of C 20.
In our C code if we know which lines of code would most probably be executed during our code execution then we can use likely and unlikely attributes , which is our way of saying to the compiler which lines of code would be most probably be executed and thus compiler can optimize it's execution ( by code scheduling ) and that would result in faster code execution.

Before the release of C 20 we ...

 •  0 comments  •  flag
Share on Twitter
Published on March 08, 2021 08:39
No comments have been added yet.