delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/22/23:15:23

From: Neil & Joey Obremski <obremski AT nwrain DOT com>
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,rec.games.programmer
Subject: Template Class as Object Function Parameter
Date: Thu, 22 Jan 1998 20:14:37 -0800
Organization: CyCLONE7 Design
Lines: 20
Message-ID: <34C8192D.6DE290C4@nwrain.com>
Reply-To: obremski AT nwrain DOT com
NNTP-Posting-Host: 6167 AT 205 DOT 134 DOT 220 DOT 119
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I was just wondering why the following code doesn't work.  I have a
template class called Array.  And in one function I wish to have a
parameter that is of this class and the SAME type as the current class
object.  So I naturally thought that 'Array<dt> *src' would work, but i
get errors.  Please help =)

template <class dt>
int Array<dt>::copy (Array<dt> *src, long int loc)
{

  // --- function meat goes here =) --- \\

  return 0;
}

Thanx in advance!

-- 
Neil C. Obremski / Ashrak DeadEye -          nobremski AT hotmail DOT com
.G  I  B  D  O  N.   .M  O  O  N. - http://www.nwrain.com/~deadeye

- Raw text -


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