home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13190 < prev    next >
Encoding:
Text File  |  1992-09-01  |  1.6 KB  |  36 lines

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