I am wondering what the overhead is of having unused functions in your code.
Say for example you have some debug logging, and you then give most of your objects a To
It depends on the compiler and, I guess, optimization level.
G++ and MSVC++ remove unused inline functions but keep unused non-inline functions. For instance, you use only a small fraction of the STL in a normal program. All unused functions get removed, because they're defined as inline.
GCC on the other hand keeps all functions, even unused inline ones.
Answer to your other question: if a function is somehow defined in multiple compilation units, the linker will frown and refuse to link, unless if it is defined as inline.