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: C++ automatic template instantiation?


* Tudor Hulubei (tudor.hulubei@ecora.com) [20000419 23:08]:

> > There is code in gcc 2.95.2 to replace manual template
> > instantiation. Just compile without -frepo, and all will work fine.
> 
> Isn't that going to make your code n times larger because it will
> instantiate all the templates in all the object files?

Yes, the templates will be instantiated in each object as needed, so the sum
of all object sizes wil grow and compile time most probably too. But on ELF
platforms, all instantiations besides one will be discarded, so the in the
end, the result should be the same.

Philipp

-- 
Philipp Thomas <pthomas@suse.de>
Development, SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany

#define NINODE  50              /* number of in core inodes */
#define NPROC   30              /* max number of processes */
 	-- Version 7 UNIX fuer PDP 11, /usr/include/sys/param.h

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