Actually, prior to C++11 the standard defined the export
keyword that would make it possible to declare templates in a header file and implement them elsewhere.
None of the popular compilers implemented this keyword. The only one I know about is the frontend written by the Edison Design Group, which is used by the Comeau C++ compiler. All others required you to write templates in header files, because the compiler needs the template definition for proper instantiation (as others pointed out already).
As a result, the ISO C++ standard committee decided to remove the export
feature of templates with C++11.