C++20 in Action
C++ attribute: likely, unlikely - C++20
Allow the compiler to optimize for the case where paths of execution including that statement are more or less likely than any alternative path of execution that does not include such a statement.
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
refer:
- How to use C++20’s likely/unlikely attribute in if-else statement
- How do the likely/unlikely macros in the Linux kernel work and what is their benefit?
C++ Sized Deallocation - C++14
- Sized deallocation in C++: What is the correct behaviour of the global operator delete(void* ptr, std::size_t size)
- https://isocpp.org/files/papers/n3778.html