I apologize if I am off base, but it seems like you may have the wrong idea of what a header file does. Wikipedia has a decent enough entry on the subject that might clear things up for you.
Took me a while, but I found it in the textbook...
In regards to template classes:
"There is, however, one additional change that you need to make in the class definition.
In order for the compiler to create the specific classes that are instances of the general
template, it must have access to both the interface and the implementation. To achieve
this goal, you could include the implementation directly in the header file, but this would
have the undesirable effect of exposing clients to the details of the implementation. A
useful strategy for providing those details to the compiler while hiding them from the
client is to use the #include facility to read in the implementation when it is needed."
It doesn't really give any explanation why though?!?! Still confused!
Ok, well, the 'package' we're learning about in school is a generic queue, so I have my template class queue.h file, my private queuepriv.h file, and my queue.cpp implementation. Obviously the implementation includes the header, I do that by default, but why does the textbook tell me I need to include the implementation into the header??
"In order for the compiler to create the specific classes that are instances of the general
template, it must have access to both the interface and the implementation." <--- I have no idea what this means...
I would guess it is indicating that your template implementation code should also be in your header file, not that you should #include your source file in the header.
"implementation" does not always mean your source file.
With C++ templates, which are similar to C macros, you need to have the implementation visible when calling a function ( Since the compiler will instanciate it only when necessary ).
You can split template declarations/definitions in separate files and have one #including both to give visibility to declaration and implementation but never a .cpp file ( or other extensions usually associated with C++ sources ) since they are by default compiled when passed to a compiler ( and this is something you don't want )