home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 12880 < prev    next >
Encoding:
Text File  |  1992-08-25  |  2.1 KB  |  40 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!princeton!phoenix.Princeton.EDU!fmidgley
  3. From: fmidgley@phoenix.Princeton.EDU (Frank M. Midgley)
  4. Subject: Re: SOLVED: Template functions and g++  :-)
  5. Message-ID: <1992Aug25.224616.9948@Princeton.EDU>
  6. Summary: template confusion
  7. Originator: news@nimaster
  8. Keywords: g++, templates 
  9. Sender: news@Princeton.EDU (USENET News System)
  10. Nntp-Posting-Host: phoenix.princeton.edu
  11. Organization: Princeton University
  12. References: <1992Aug24.154351.24827@ugle.unit.no> <1992Aug24.163827.25725@ugle.unit.no> <1992Aug25.110541.717@ugle.unit.no>
  13. Date: Tue, 25 Aug 1992 22:46:16 GMT
  14. Lines: 24
  15.  
  16. g++ templaters:
  17.   Bjoern Much has posted some of his code which allows templates to work under
  18. g++.  The problem I have is not with the code itself, but with the fact that it
  19. was necessary to create a .h file for every occurence of a template.
  20.  
  21.   I started using templates because I wanted to get rid of the 30 or so files I
  22. had that implemented 6 linked lists with a common base using libg++.  I can't
  23. see why the compiler can't be happy with just the template.  I don't see why
  24. the compiler has to be 'spoon fed' such information as when to actually
  25. generate the code for a template.
  26.   I was under the impression that with templates, only one copy of the template
  27. code was ever generated, thus giving templates their desirability.  If this is
  28. the case, can't the compiler generate the template code for the .cc file
  29. containing the template and leave 'hooks' to attach whatever type is being
  30. 'templated'?  This seems simply a matter of a few void*'s.
  31.   I may be ranting, but it seems reasonable to me.  Anyway, any comments or
  32. descriptions of how templating can be accomplished w/out extra files will be
  33. _gladly_ accepted.
  34.         -Frank
  35. -- 
  36. /-----------------------------------------------------------------------------\
  37. | fmidgley@phoenix.princeton.edu  |    This space left blank due to a lack    |
  38. |                                 |                                           |
  39. | "Your fault -- core dumped."    |    of imagination.          So sue me.    |
  40.