Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!cadnetix.COM!mitch From: mitch@cadnetix.COM Newsgroups: comp.lang.c++,local.c++ Subject: Re: C++ 2.0 bug? Message-ID: <10601@cadnetix.COM> Date: 15 Dec 89 21:31:11 GMT Sender: news@cadnetix.COM Reply-To: mitch@cadnetix.COM () Organization: Cadnetix Corp., Boulder, CO Lines: 59 Once again, I am posting this for my friend, who will soon have access to the net (waiting on modem to arrive). This is a followup to the original posting, made December 12, with the same "Subject:" line (minus the "Re:" part, of course). Again, I must request that you EMAIL REPLIES to me, as I do not read this group with regularity. And a public "Thank you" for all those who already have and/or will respond... :-) =================== Included Query Begins Here ===================== Regarding my posting about a problem with making a destructor a friend of another class, I have received a couple of replies suggesting the following: > class A { > A(); > ~A(); > }; > > class B : public A { > B(); > ~B(); > }; First of all, publicly deriving class B from class A would indeed allow the access that I desire. But it is *NOT* the point of the original posting. The classes that I am actually working with are *NOT* meant to be derived from each other; I merely wish that the destructor for one class be able to get at private data of another class. I suppose that I should have stated this more clearly in my original posting, but I incorrectly assumed that it was obvious from my example. Perhaps someone can set me straight, but I don't recall reading in any C++ book or documentation, that declaring a destructor to be a friend of another class is illegal. Additionally our ATT 1.2 C++ compiler likes it just fine. (Yes I know that doesn't make it OK.) I realize that there might be some difficulty with doing this, since destructors are not supposed to have return types, but I rather suspect that it is something that just slipped through the cracks in 2.0. I would like to hear from either a "Language Lawyer" type person or an implementor with regards to why this should be prohibited or that it is just a bug. On a related note, I have heard rumors about a book that Stroustrup (or someone) was working on for language implementors. Is it real? Is it in print yet? I would very much like to get my hands on a copy. ===================== End of Included Query =================== Responses can be emailed to me at the address listed below. Thanks again for your time and patience. -Mitch Mitch Black UUCP: ..!{uunet,boulder}!cadnetix!mitch Daisy/Cadnetix Corp. Internet: mitch@cadnetix.com 5775 Flatiron Pkwy. Boulder, CO 80301 Voice: (303) 444-8075