From 9090341048981635173
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7961205d5764d0b
X-Google-Attributes: gidf78e5,public
From: Francis Glassborow <francis@robinton.demon.co.uk>
Subject: Re: A suspect bug in Visual C++
Date: 1998/11/30
Message-ID: <V+3wzmA5FdY2EwQc@robinton.demon.co.uk>#1/1
X-Deja-AN: 416937276
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <8767c1s375.fsf@pot.cnuce.cnr.it> <GqF0WmAxWJY2Ewyw@robinton.demon.co.uk> <3661A689.4C80EFFE@ibm.net>
Organization: Southfield Microcomputer SS
Mime-Version: 1.0
Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
Newsgroups: comp.std.c++
Originator: clamage@taumet


In article <3661A689.4C80EFFE@ibm.net>, Biju Thomas <bijuthom@ibm.net>
writes
>Without such a feature, declaring friends of nested classes becomes a
>nightmare, as all the containing classes have to have the same friend
>declaration. And, having such a friend declaration in the containing
>class is dangerous, as it will expose the containing class the friend
>class/function unnecessarily.

Off the cuff (its getting late this side of the Atlantic) Why not make
the nested class B a public member of A but without any public members
of its own.  It can befriend the enclosing class A if members of A need
access.

I don't really care because I would deeply suspect code that had private
nested classes declaring friendship to namespace scope functions.
However I was merely responding to the reflex reaction that if VC++
disagrees with any other compiler that it must be wrong.



Francis Glassborow      Chair of Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation


[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]




