I've just been researching the use and benefits/pitfalls of the C++ keyword inline
on the Microsoft Website and I understand all of that.
My question is this: if the compiler evaluates functions to see if inlining them will result in the code being more efficient and the inline
keyword is only a SUGGESTION to the compiler, why bother with the keyword at all?
EDIT: A lot of people are moaning about my use of (Also fixed the website link)__inline
instead of inline
. I'd like to point out that __inline
is the Microsoft specific one: so it's not wrong, it's just not necessarily what you're used to.
EDIT2: Re-formatted the question to indicate the inline
keyword (used across all of C++) instead of the Microsoft-specific __inline
keyword.