This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Q: template instantiation


| 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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]