Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: template fr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 13 Topic 43367 of 48417
Post > Topic >>

Re: template friend class

by James Kanze <james.kanze@[EMAIL PROTECTED] > Feb 18, 2008 at 02:04 AM

On Feb 17, 10:28 pm, Kira Yamato <kira...@[EMAIL PROTECTED]
> wrote:
> A question about declaring a friend class.  The following does not
compile=
:

> template<class C>
> class B
> {
> public:

> friend class C;
> };

> g++4.0.1 returns the error message

>     error: using template type parameter 'C' after 'class'

> So, is there a way to declare a friend class from the template
parameter?

Not at present.  The next version of the standard will allow:

    template< typename C >
    class B
    {
        friend C ;
    } ;

Until then, you're out of luck.

--
James Kanze (GABI Software)             email:james.kanze@[EMAIL PROTECTED]
 en informatique orient=E9e objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34
 




 13 Posts in Topic:
template friend class
Kira Yamato <kirakun@[  2008-02-17 16:28:10 
Re: template friend class
Jeff Schwab <jeff@[EMA  2008-02-17 13:46:39 
Re: template friend class
Kira Yamato <kirakun@[  2008-02-17 17:01:35 
Re: template friend class
Pavel <dot_com_yahoo@[  2008-02-17 22:46:07 
Re: template friend class
=?ISO-8859-1?Q?Marcel_M=F  2008-02-18 21:42:52 
Re: template friend class
aaragon <alejandro.ara  2008-02-17 15:42:44 
Re: template friend class
Kira Yamato <kirakun@[  2008-02-17 19:08:50 
Re: template friend class
Jeff Schwab <jeff@[EMA  2008-02-17 16:09:52 
Re: template friend class
Kai-Uwe Bux <jkherciue  2008-02-17 20:06:19 
Re: template friend class
James Kanze <james.kan  2008-02-18 02:04:35 
Re: template friend class
Kai-Uwe Bux <jkherciue  2008-02-18 08:29:14 
Re: template friend class
James Kanze <james.kan  2008-02-18 10:00:10 
Re: template friend class
Kai-Uwe Bux <jkherciue  2008-02-18 22:53:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 10:32:35 CST 2008.