home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!darkstar.UCSC.EDU!dlong
- From: dlong@cse.ucsc.edu (Dean R. E. Long)
- Newsgroups: comp.lang.c++
- Subject: inline member function (constructor) and templates
- Date: 29 Jan 1993 03:04:30 GMT
- Organization: University of California, Santa Cruz (CE/CIS Boards)
- Lines: 26
- Distribution: world
- Message-ID: <1ka6ruINN6tp@darkstar.UCSC.EDU>
- NNTP-Posting-Host: oak.ucsc.edu
-
- Should this piece of code work? The non-template version does.
-
- dl
-
- --------
-
- oak /tmp [118] % cat b.c
- template <class T>
- class A {
- public:
- A(void);
- };
-
- template <class T>
- inline A<T>::A(void) {}
-
- int main(void)
- {
- A<int> x;
- }
- oak /tmp [119] % /usr/local/C++3.0.1/bin/CC b.c
- CC b.c:
- "b.c", line 8: error: A <int >::A__pt__2_i() declared with external linkage and called before defined as inline
- "b.c", line 8: error detected during the instantiation of A <int >
- "b.c", line 14: is the site of the instantiation
- 1 error
-