delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/31/15:45:25

From: "Lars Hansen" <lars DOT o DOT hansen AT gmx DOT de>
Newsgroups: comp.os.msdos.djgpp
References: <393176dd AT news DOT ivm DOT net>
Subject: Re: template friend
Date: Wed, 31 May 2000 21:36:40 +0200
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-Mimeole: Produced By Microsoft MimeOLE V5.00.2919.6600
Organization: debitel.net - der Onlinedienst
X-NNTP-Posting-Host: 62.54.41.190
NNTP-Posting-Host: mwnews.dnsg.net
Message-ID: <393569cd@news.ivm.net>
X-Trace: 31 May 2000 21:36:45 CET, mwnews.dnsg.net
X-Complaints-To: usenet AT ivm DOT net
X-Admin-Comment: X-NNTP-Posting... are valid if present
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

' template<class T, class U> friend class A; '
declares all  'A' s  as a friend of the object this expression is used in.

' friend class A<T,U>; '
declares specifically A<T,U> as a friend.

That should be ANSI-C++  and  DJGPP 2.03 understands that.

But the answer to your problem is different: a small forward-declaration is
necessary:
' template<class TT> class Two; '

That's what the debugger is saying: 'c' is undeclared, meaning its type is
unknown (so far).


- Raw text -


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