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

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!sgiblab!cs.uoregon.edu!ogicse!uwm.edu!rpi!clarkson!grape.ecs.clarkson.edu!anstey
  2. From: anstey@sun.soe.clarkson.edu (Charles Anstey)
  3. Newsgroups: comp.lang.c++
  4. Subject: GCC2.2 doesn't inline template class functions. Normal?
  5. Message-ID: <ANSTEY.92Aug26014202@sunspot.clarkson.edu>
  6. Date: 26 Aug 92 06:42:02 GMT
  7. Article-I.D.: sunspot.ANSTEY.92Aug26014202
  8. Sender: news@news.clarkson.edu
  9. Distribution: comp.lang.c++
  10. Organization: Clarkson University, Potsdam NY
  11. Lines: 22
  12. Nntp-Posting-Host: sunspot.ece.clarkson.edu
  13.  
  14. While playing around with GCC2.2, I noticed that it does not inline
  15. template class member functions.  Is this typical of all compilers for
  16. reasons I do not know?  GCC2.2 will inline member functions of a
  17. non-template class.
  18.  
  19. The examples was quite simple.
  20. template <class PT>
  21. class S {
  22. private:
  23.   PT length;
  24. public:
  25.   S (int size):length(size) {};
  26.   PT size () { return (length);};
  27. };
  28.  
  29. S.size() is not inlined.  If I remove the template PT and change it to 'int'
  30. then it is inlined.
  31.  
  32. Anyone know why?
  33.  
  34. Thanks in advance.
  35. -Charles Anstey
  36.