Hi,
I usually separate template class definitions in 3 files, a .h for declaration, a .cpp for method definition and a .hpp for "template-dependent" method definitions. Standard procedure.
I understand its best to keep the .hpp file to a minimum (to avoid code bloating, long preprocess times, etc.). Bu I'm lazy so I usually just put everything in the .cpp file to start with, and then move the definitions to the .hpp every time there's a compilation error.
My question is this:
How am I going to know in advance what I have to put in the .hpp file?
I understand what a compilation unit is, and I understand why some definitions are needed at compile-time, but I can't seem to apply theory to actual cases.
Could someone break it down the simple way for me?
Secondary question:
What's an official terminology for those methods that need to be defined in the .hpp file. I don't like that "template-dependent" I used earlier