Re:How to properly use macros in C
by rocqua on Sunday December 10, 2017 @05:30PM
(#15893841)
> When you add the inline keyword in front of a function, you are hinting the compiler to embed the function body inside the caller (just like a macro).
That is not quite the case. The inline keyword has changed to mean multiple definitions are allowed. To quote [1]:
" Because the meaning of the keyword inline for functions came to mean 'multiple definitions are permitted' rather than 'inlining is preferred' "
That is not quite the case. The inline keyword has changed to mean multiple definitions are allowed. To quote [1]: " Because the meaning of the keyword inline for functions came to mean 'multiple definitions are permitted' rather than 'inlining is preferred' "
[1] http://en.cppreference.com/w/cpp/language/inline