Optimize templates compilation time in c++/gcc

view full story

http://stackoverflow.com – In a large project we have a lot of classes (thousands), and for each of them a special smart pointer type is defined using typedef. This smart pointer type is a template class. When I compile with "gcc -Q" I see that a lot of time is spent compiling these smart pointers for each class. That is I see smartptr<class1>::methods, then smartptr<class2>::methods... smartptr<class2000>::methods scrolling on the screen as gcc processes them. Is there a trick to speedup this process? These classes are all the same from the smartptr point of view, no enable_if tricks, etc. What I am (HowTos)