This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Q: template instantiation
- To: niksa at uta dot fi (Niku Kaitaniemi)
- Subject: Re: Q: template instantiation
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Sat, 22 Aug 1998 19:55:12 +0200 (CEST)
- Cc: egcs at cygnus dot com (egcs at cygnus dot com)
| What is the optimal way of instantiating templates, measured by
| compile time and g++ memory usage?
Using -fno-implicit-templates is faster in my experience (than
not using it).
| I am currently instantiating templates explicitly the way I did with g++
| v2.7.2. I include only template declarations in normal source files, which
| are compiled with -fno-implicit-templates. Then I have at least one
| template instantiation source file, that includes template definitions and
| explicitely instantiates all templates used in the project and is compiled
| without -fno-implicit-templates.
You can use -fno-implicit-templates for that file too.
I myself put the template instantiations in the source files in which
they are used most - but I have no reason to assume that makes a difference.
--
Carlo Wood <carlo@runaway.xs4all.nl>