Since templates are defined within headers and compiler is able to determine if inlining a function is advantageous, does it make any sense? I've heard that modern compilers know better when to inline a function and are ignoring inline
hint.
edit: I would like to accept both answers, but this is not possible. To close the issue I am accepting Sebastian Mach's answer, because it received most votes and he is formally right, but as I mentioned in comments I consider Puppy's and Component 10's answers as correct ones too, from different point of view.
The problem is in C++ semantics, which is not strict in case of inline
keyword and inlining. Sebastian Mach says "write inline if you mean it", but what is actually meant by inline
is not clear as it evolved from its original meaning to a directive that "stops compilers bitching about ODR violations" as Puppy says.