From -5015528672733305791
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,707adf8c47900f8d,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-10 13:28:13 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: kstuart.subs@btinternet.com ("Kenny Stuart")
Newsgroups: comp.std.c++
Subject: It's a question of friends...
Date: Tue, 10 Sep 2002 20:28:12 +0000 (UTC)
Lines: 41
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <alkpge$bcm$1@newsg2.svr.pol.co.uk>
X-Trace: mail2news.demon.co.uk 1031689692 13408 10.0.0.1 (10 Sep 2002 20:28:12 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 10 Sep 2002 20:28:12 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 17orcJ-0003U7-00
	for mail2news@news.news.demon.net; Tue, 10 Sep 2002 20:28:11 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id GAA07032; Wed, 11 Sep 2002 06:27:38 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: 10 Sep 2002 12:45:02 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Xref: archiver1.google.com comp.std.c++:13764

Hi all,

 Can someone answer a question regarding the C++ standard and tell me if the
following non-elaborated friend declaration is legal, I can't find a section
in the standard that explicitly allows or disallows this
([14.5.3/temp.friend], [11.4/class.friend]), it works on most compilers but
g++ (GCC) 3.2 disallows it with the message 'template parameters cannot be
friends', the second example however works fine with g++.

template<typename _T>
class A{
 friend _T;
};

class B{};
typedef A<B> C;

------------------------------------------------------

template<typename _T>
class A2{
 typedef typename _T::its_still_me_but_not_as_a_template_parameter  T;
 friend T;
};

class B2{ typedef B2 its_still_me_but_not_as_a_template_parameter; };
typedef A<B2> C2;


thanks.

Kenny Stuart.



---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



