C++ templates have been a blessing in my everyday work because of its power. But one cannot ignore the (very very very very long) compilation time that results from the heav
The main problem with templates is the following:
You cannot (usually) separate the definition of your templates class from its declaration and put it inside a .cpp file.
The consequence: Everyting is in header files. Whenever you include a header you include a whole lot of code that would in normal circumstances be nicely separated into .cpp files and compiled separately. Every compile unit includes a few headers, and so, with templates, every compile unit contains a lot of code, or almost all of your project, via the included headers.
If that is your problem, then look here, at a related question:
It got a very good answer, which does solve that problem.
Basically, it involves instantiating the templates that you need once, and compile them into an object file. Later you can link against it, and you don't have to include that code everywhere. It's separated into a compiled object file. Note: That makes sense only if you use only just a few instantiated types of your templates (say, you only need MyType and MyType in your program).
It uses the g++ flag -fno-implicit-templates.
That technique is so helpful that I think it should be incorporated into the C++ faq: [35.12] Why can't I separate the definition of my templates class from it's declaration and put it inside a .cpp file?