
Simonson, Lucanus wrote:
If, by some strange coincidence, you happen to be implementing a non-template class and leave out the inline keyword when defining a static member function in the header file as part of the class definition, or any other kind of function, for that matter, you end up with a multiple function definition link-time error when the header is included in multiple execution units. Specifying the inline keyword forces the compiler to make the function signature a weak symbol and eliminates the link time error.
Defining member functions directly within the class definition already has that effect. Such functions are implicitly inline according to the C++ standard. The "inline" keyword is useless there as far as the C++ standard is concerned. Now, maybe some compilers consider specifying it explicitly an additional hint with regards to inlining, and that's the real question of that thread.