home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!sgiblab!cs.uoregon.edu!ogicse!uwm.edu!rpi!clarkson!grape.ecs.clarkson.edu!anstey
- From: anstey@sun.soe.clarkson.edu (Charles Anstey)
- Newsgroups: comp.lang.c++
- Subject: GCC2.2 doesn't inline template class functions. Normal?
- Message-ID: <ANSTEY.92Aug26014202@sunspot.clarkson.edu>
- Date: 26 Aug 92 06:42:02 GMT
- Article-I.D.: sunspot.ANSTEY.92Aug26014202
- Sender: news@news.clarkson.edu
- Distribution: comp.lang.c++
- Organization: Clarkson University, Potsdam NY
- Lines: 22
- Nntp-Posting-Host: sunspot.ece.clarkson.edu
-
- While playing around with GCC2.2, I noticed that it does not inline
- template class member functions. Is this typical of all compilers for
- reasons I do not know? GCC2.2 will inline member functions of a
- non-template class.
-
- The examples was quite simple.
- template <class PT>
- class S {
- private:
- PT length;
- public:
- S (int size):length(size) {};
- PT size () { return (length);};
- };
-
- S.size() is not inlined. If I remove the template PT and change it to 'int'
- then it is inlined.
-
- Anyone know why?
-
- Thanks in advance.
- -Charles Anstey
-