C++: When (and when not!) to use inline (static/extern)

https://stackoverflow.com/questions/1759300/when-should-i-write-the-keyword-inline-for-a-function-method/1759575#1759575

in short: inlince/static/extern are linkage directives for the linker and mostly ignored by the compiler

inline
The linker will sort out multiple definitions of the same symbol (thus not to break the one-definition rule ODR). Especially it is not treated anymore as a hint to the compiler to optimize/inline the function call!

Leave a comment