delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/14/21:19:27

From: drathj01 AT xlab1 DOT fiu DOT edu (daniel k rathjens)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: djgpp & templates
Date: 14 May 1997 23:18:28 GMT
Organization: Florida International University
Lines: 20
Message-ID: <5ldh84$dr6@isis.fiu.edu>
References: <Pine DOT BSF DOT 3 DOT 95q DOT 970508231226 DOT 273B-100000 AT rook DOT matranet DOT org>
NNTP-Posting-Host: xlab1.fiu.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

matra (matra AT diemme DOT it) spake thus:

: This is my problem : this simple class doesn't compile ! 
: WHY!??? ... :-<<<<
: template <class T> myclass<T>::myclass(T tinf)
: {
: 	cout << "Hello World!" << endl;
: 	inf = tinf;
: }
you need to specify a type that the function is going to return.
template <class T>
void myclass<T>::myclass(T tinf)
^^^^
  like that

--
-----BEGIN GEEK CODE BLOCK-----   Version: 3.1
GCS/M/S d+(-) s+:- a-- C+++>$ ULSC++>+++$ P+? L++ E W++(+) N+++ o K w++ 
!O !M- V- PS PE+ Y-- PGP- t++@ !5 X+ R+ tv b+++ DI+ D+ G++ e+ h r y?     
------END GEEK CODE BLOCK------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019