home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!princeton!phoenix.Princeton.EDU!fmidgley
- From: fmidgley@phoenix.Princeton.EDU (Frank M. Midgley)
- Subject: Re: SOLVED: Template functions and g++ :-)
- Message-ID: <1992Aug25.224616.9948@Princeton.EDU>
- Summary: template confusion
- Originator: news@nimaster
- Keywords: g++, templates
- Sender: news@Princeton.EDU (USENET News System)
- Nntp-Posting-Host: phoenix.princeton.edu
- Organization: Princeton University
- References: <1992Aug24.154351.24827@ugle.unit.no> <1992Aug24.163827.25725@ugle.unit.no> <1992Aug25.110541.717@ugle.unit.no>
- Date: Tue, 25 Aug 1992 22:46:16 GMT
- Lines: 24
-
- g++ templaters:
- Bjoern Much has posted some of his code which allows templates to work under
- g++. 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 started using templates because I wanted to get rid of the 30 or so files I
- had that implemented 6 linked lists with a common base using libg++. 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.
- I was under the impression that with templates, only one copy of the template
- code was ever generated, thus giving templates their desirability. 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.
- I may be ranting, but it seems reasonable to me. Anyway, any comments or
- descriptions of how templating can be accomplished w/out extra files will be
- _gladly_ accepted.
- -Frank
- --
- /-----------------------------------------------------------------------------\
- | fmidgley@phoenix.princeton.edu | This space left blank due to a lack |
- | | |
- | "Your fault -- core dumped." | of imagination. So sue me. |
-