🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #1092

Re: Problem with friendly templates

#1092
From: Russell Zornes
Date: Tue, 20 Nov 2001 06:06
22 lines
1679 bytes
in article mjolnir_DELETE_-279068.14135819112001@east.usenetserver.com, Adin
Hunter Baber at mjolnir_DELETE_@soltec.net wrote on 11/19/01 12:13 PM:

> I was told that if you want to have a template type be friends with one
> another you need to declare it like this:
> 
> template<class T>
> class temClass
>  {
>  public:
>     ...
>     template<class U> friend class temClass<U>;
>  ...
>  };
> 
> However, if i write my code this way I get a "declaration syntax error"
> and the Error & Warnings Window has friend underlined.

Your syntax for a template friend is correct but there is a bug in CW that
prevents it from compiling. I think Ron said this will be fixed in Pro 8.

-Russ
Technical Details
Message-ID: <B81F32CA.8966%rzornes@bayarea.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews3
References: <mjolnir_DELETE_-279068.14135819112001@east.usenetserver.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,45060c4a2ff696d4
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,45060c4a2ff696d4
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2001-11-19 22:35:43 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews3
From: Russell Zornes <rzornes@bayarea.net>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: Re: Problem with friendly templates
Date: Mon, 19 Nov 2001 22:06:03 -0800
Organization: http://extra.newsguy.com
Lines: 24
Message-ID: <B81F32CA.8966%rzornes@bayarea.net>
References: <mjolnir_DELETE_-279068.14135819112001@east.usenetserver.com>
NNTP-Posting-Host: p-339.newsdawg.com
Mime-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
User-Agent: Microsoft-Entourage/9.0.2509