Article View: borland.public.cppbuilder.oodesign
Article #43Re: How to make a template class friend of another class.
From: Wiljo
Date: Mon, 07 Mar 2005 10:51
Date: Mon, 07 Mar 2005 10:51
22 lines
1965 bytes
1965 bytes
Thomas Maeder [TeamB] wrote: > Do you want all specializations of B to be friends of A, or just one > particular specialization? > Yes, I want all specializations of B to be friend of A. > > What's the point in making B a template? Well I oversimplified the example code a bit too much, and I didn't make sense anymore. B needs to be template, because it handles several different object types. The one thing they have in common is that they are all derived from class A. A has private functionality, that I don't wan't to access directly from any derived class, hence the private specifier. I DO wan't to access these private functionality from the template class though. Hence my question. I solved the problem by making a base class for the template class B. This base class can be friend of A without any problem. Thanks anyway. Wiljo.
Technical Details
Message-ID:
<422c326b$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newshosting.com!nx02.iad01.newshosting.com!news-out.superfeed.net!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<421d9d32$1@newsgroups.borland.com> <m2r7j5devc.fsf@madbox2.local>Show Full Headers
Complete Article Headers
X-Google-Thread: 10db1e,bcb6be07da14baed X-Google-Attributes: gid10db1e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 07 Mar 2005 11:51:59 +0100 From: Wiljo <invalid@invalid.address> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.oodesign Subject: Re: How to make a template class friend of another class. References: <421d9d32$1@newsgroups.borland.com> <m2r7j5devc.fsf@madbox2.local> In-Reply-To: <m2r7j5devc.fsf@madbox2.local> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.207.96.249 Message-ID: <422c326b$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1110192747 81.207.96.249 (7 Mar 2005 02:52:27 -0800) Lines: 22 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newshosting.com!nx02.iad01.newshosting.com!news-out.superfeed.net!propagator3-LAX.newsfeeds.com!news-in.usenet.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail