Templates need to be instantiated by the compiler before actually compiling them into object code. This instantiation can only be achieved if the template arguments are known. Now imagine a scenario where a template function is declared in
a.h, defined in
a.cppand used in
a.cppis compiled, it is not neccessarily known that the upcoming compilation
b.cppwill require an instance of the template, let alone which specific instance would that be. For more header and source files, the situation can quickly get more complicated.
Best 101 explanation.