Path: utzoo!utgpu!attcan!uunet!ateng!chip From: chip@ateng.uucp (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: Friend specifier considered harmful Message-ID: <1988Sep2.174327.6439@ateng.uucp> Date: 2 Sep 88 21:43:26 GMT References: <61@cybaswan.UUCP> Reply-To: chip@ateng.UUCP (Chip Salzenberg) Organization: A T Engineering, Tampa, FL Lines: 16 According to eeartym@cybaswan.UUCP (Dr R.Artym eleceng ): > Do YOU have a c++ program that couldn't have been written without >the friend specifier? Well, there is almost no language feature which is truly indispensible, but I used "friend" once where it proved very useful: an implementation of a hash table. The HashTable class contains an array of pointers to HashNode. Each HashNode contains a pointer to the next HashNode. I made HashTable a friend of HashNode. This allowed easy access to the HashNode "next" pointer but _only_ for HashTable member functions. -- Chip Salzenberg or A T Engineering My employer may or may not agree with me. The urgent leaves no time for the important.