2 ms·
> 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 i
by rocqua 9y ago
> 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' "
[1] http://en.cppreference.com/w/cpp/language/inline http://en.cppreference.com/w/cpp/language/inline