Talk:C++ Programming/Optimization

Function and algorithmic optimizations
As an example of mathematical optimization could be included:

if ((unsigned)(number-lower) <= (upper-lower)) in_range(number);

instead of

x >= start && x <= end

(source: http://stackoverflow.com/questions/17095324/fastest-way-in-c-to-determine-if-an-integer-is-between-two-integers-inclusive?newsletter=1&nlcode=172833%7c19ab)

Use of
Must be said that the use of the key word could fall into lazy optimization. Increasing the size of the program, consequently increasing the cache miss rate.