www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/01/31/14:32:55

Date: Mon, 31 Jan 1994 14:14:59 -0500
From: garym AT argos DOT rose DOT utoronto DOT ca (Gary Lawrence Murphy)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Weird messages

Well, it seems from the asm output, the C++ is happy to provide
a compilation for the ostream operator friend function of a
template class, but AS is not so amiable :-)

Now, rather than a DJGPP-problem, I think I have a generic C++
problem.  I have a template class of Coordinate<T> and I want to
define
        friend ostream& operator<<(ostream&s, Coordinate<T>&c)

for various values of T (int, float, double &c).

Outside the class declaration, if I don't use the <type> tag on the
class name, I get a syntax error (parse error before &) and if I do,
the compiler is happy, but not the assembler.  Inside the class, I can
declare this function as a friend with a second parameter of just
"Coordinate&", but how do I define this outside the class?  (ie. where
I define the function body)

Gary Lawrence Murphy ----------------- garym AT virtual DOT rose DOT utoronto DOT ca
University of Toronto ---------- 4 Taddle Creek, Toronto, Ont M5S 1A4
Human Factors, Ind Engineering ------------ fax/voice: (416) 978-3776
----------------------- The true destination is always just here, now


- Raw text -


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