Continued from C++ Function definitions in header
Note that template functions need to be defined in headers so that they can be instantiated as needed in the code. Linker will then eliminate duplicate instantiations. Cf armlink - Elimination of common groups or sections.
Similar to how only the linker can eliminate non-static functions, see C++ static function (a)