"Pe*******@gmail.com" <Pe*******@gmail.comwrote in
news:11**********************@22g2000hsm.googlegro ups.com:
Hi,
One problem to use templates extensively is that it tends to take a
long time to compile. Other than changing to a different compiler, are
there any techniques to reduce the compile time?
1. Precompiled headers - if your compiler supports precompiled headers, put
all template header includes into it and use it in all .cpp-s.
2. If your templates work on a limited number of types, put the actual
template definitions in .cpp files and add explicit template instantiations
for all needed types there. Might not work over dll/so boundaries.
3. Add more memory to your computer!
Thanks,
Peng
you are welcome!
Paavo