(ref.doc)grumpy 220893

Next kim 030993 Prev: jimad 190893 Up: Usenet

Newsgroups: comp.lang.c++
From: [email protected] (Paul J Lucas)
Subject: Re: templated friend functions and classes
Organization: AT&T Bell Laboratories
Date: Sun, 22 Aug 1993 02:14:33 GMT

From article <[email protected]>, by [email protected] (Ray Fergerson):
> I'm having a "discussion" with my compiler vendor concerning templated
> friend functions.  In particular is the following valid C++:
> 
> class Foo {
> 	public:
> 		Foo();
> 	private:
> 		template <class T> friend class Bar;
> 		template <class T> friend void foo(T*);
> };
> 
> The first friend declaration is given in Lippmann, p361.  The 
> second (for templated friend functions) I cannot find anywhere.
> Are templated friend functions allowed?  If not then why not?
> I can't find anything one way or the other in my references.
> If they are allowed does anyone know of a written reference to 
> one by a "heavyweight" author (Stroustrup, Lippmann, etc).

	As far as I know, the forthcoming standard does not yet
	explicity state that the above is legal.  It is discussed in a
	working paper by Spicer.  It makes perfect sense and I would be
	very surprised if it does not make it into C++.  
-- 
	- Paul J. Lucas
	  AT&T Bell Laboratories
	  Naperville, IL



automatically generated by info2www version 1.2.2.8