home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!kithrup!mrs
- From: mrs@kithrup.COM (Mike Stump)
- Subject: Re: SOLVED: Template functions and g++ : -)
- Reply-To: mrs@cygnus.com
- Organization: Cygnus Support
- Date: Wed, 02 Sep 1992 09:49:00 GMT
- Message-ID: <1992Sep02.094900.7385@kithrup.COM>
- Keywords: g++, templates
- References: <1992Aug24.163827.25725@ugle.unit.no> <1992Aug25.110541.717@ugle.unit.no> <1992Aug25.224616.9948@Princeton.EDU>
- Lines: 23
-
- In article <1992Aug25.224616.9948@Princeton.EDU> fmidgley@phoenix.Princeton.EDU (Frank M. Midgley) writes:
- >The problem I have is not with the code itself, but with the fact that it
- >was necessary to create a .h file for every occurence of a template.
-
- >I can't see why the compiler can't be happy with just the template. I
- >don't see why the compiler has to be 'spoon fed' such information as when
- >to actually generate the code for a template.
-
- This is a current limitation in g++. (Or a bug if you want to call it that.)
- Not all implementations have this problem.
-
- > I was under the impression that with templates, only one copy of the template
- >code was ever generated, thus giving templates their desirability.
-
- Hum, this is definitely not the case. You can engineer this to happen (for the
- most part) in YOUR code, but it is not a general property.
-
- >If this is the case, can't the compiler generate the template code for the
- >.cc file containing the template and leave 'hooks' to attach whatever type
- >is being 'templated'? This seems simply a matter of a few void*'s.
-
- Hum, sounds nice, but template implementations are just a little bit harder
- than this. :-(
-