Does it help marking methods as inline in C++?

c++, visual-studio-2012

Solution

The `inline` keyword is somehow unrelated to inlining. It actually means: multiple definitions of this function can appear in different translation units in the same program without it being a violation of the One Definition Rule.

Use it only for that, that is, if you define a function in a header, then mark it as `inline` (so that multiple translation units that include the header and thus generate the function can be linked together).

Problem

I think I know what the inline keyword does (it seems I don't), but with today's compilers (Visual Studio 2012's C++ compiler in my case), is it respected by the compiler or does the compiler ignore it and inlines the methods it deems good for it?

Original source