I know that declaring a function as inline does not imply the function
will actually be inlined (e.g. recursive functions, etc...).
In that case, where would the function be instanciated?
My guess is that it would be instanciated in the compilation unit that
uses it. But in this case, several compilation units that use the same
inline function would mean that the linker has to deal with several
instances of the same function: shouldn't the linker fail on this?
So:
- are the linkers required to "optimize" and remove duplicate instances
of a function?
- do compilation units that require instanciating an inline function do
it only locally, not exposing the instance to the linker?
I actually never faced any such problem, as my compiler/linker handles
it somehow, but I was simply wondering what was going on really...