Why declaring C++ functions as “inline” is a waste of time…

Christopher Baus:

A few years ago there was a lot of discussion in the C/C++ community regarding the advantages of inlining of fuctions. The debate has been settled. The inline keyword exists as a hint to the complier. There are cases when inlining makes sense, but according to Mark Lacey of the Microsoft compiler team, the compiler ignores your advice. It decides what to inline and what to outline for you (ok it is possible to override this with a Microsoft specific keyword, but it isn’t recommended). And the larger the program, the LESS chance that code it will be inlined.

Comments are closed.