inline has always been a hint to the compiler, and these days compilers for the most part make their own decisions in this regard (see register).
In order to expand a function inline, the compiler has to have seen the definition of that function. For functions that are defined and used in only one translation unit, that's no problem: put the definition somewhere before it's used, and the compiler will decide whether to inline the function.
For functions that are used in more than one translation unit, in order for the compiler to see the definition of the function, the definition has to go in a header file. When you do that, you need to mark the function inline to tell the compiler and linker that it's okay that there's more than one definition of that function. (well, I suppose you could make the function static, but then you could end up wasting space with multiple copies)
inlineand writing the body in a header -- doing either one without doing both will cause linker errors if you have multiple translation units.if ( something ) return;at the beginning. The compiler was not able to inline it (or chose not to) and moving this if statement out of the function had a big impact on performance. However the function was called roughly 20 million times before the change. And it was indeed a modern compiler with optimization enabled. So in general: Don't waste your time