🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #792

Template Trouble

#792
From: S. Sullivan
Date: Wed, 26 Aug 1992 23:05
43 lines
1078 bytes
I'm running gcc 2.2.2 on Sunos 4.1.1 on a sparc 2.

Compiling the following file with g++ gives:

> g++ -c -o testd.o testd.cc
testd.cc: In function `int  main ()':
testd.cc:9: template for method `print' doesn't match any in class `QI<int>'
Exit 1


Why?

Many thanks for your help ...

Steve Sullivan
sullivan@mathcom.com


------------------ cut here -------------------------
template <class T>
class QI {
public:
  QI();
  void print() const;
private:
  T item;
  QI *next;
  };



template <class T>
QI<T>::QI() {}


template <class T>
void QI<T>::print() const {};


main () {
   QI<int> alpha();
   }
------------------ cut here -------------------------
Technical Details
Message-ID: <9208262305.AA00468@thurber.Mathcom.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mathcom.com!sullivan

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mathcom.com!sullivan
From: sullivan@mathcom.com (S. Sullivan)
Subject: Template Trouble
Message-ID: <9208262305.AA00468@thurber.Mathcom.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 26 Aug 1992 23:05:51 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 46