Boost logo

Boost :

From: rogeeff (rogeeff_at_[hidden])
Date: 2002-02-14 04:42:13


--- In boost_at_y..., Daniel Frey <daniel.frey_at_a...> wrote:
> Mark Rodgers wrote:
> >
> > From: "Daniel Frey" <daniel.frey_at_a...>
> >
> > > template< typename T > class finalize
> > > {
> > > friend T;
> > > finalize() {}
> > > };
> >
> > This has been suggested many times in the past but unfortunately
> > the standard gets in the way. See 7.1.5.3p2:
> >
> > "If the identifier resolves to a typedef-name or a template
> > type-parameter, the elaborated-type-specifier is ill-formed.
> > [Note: this implies that, within a class template with a
> > template type-parameter T, the declaration
> >
> > friend class T;
> >
> > is ill-formed. ]"
>
> I do not have the standard, but I always thought that 'friend T;' is
> legal while 'friend class T;' isn't. Are you saying that they are
both
> illegal? Can someone please confirm this? If yes: Is there any
(legal)
> way to make a template parameter a friend?

Sadly, No. Find previos thread on class properties and see detailed
explanations.

[...]

> Daniel Frey
>
> aixigo AG - financial training, research and technology
> Schloß-Rahe-Straße 15, 52072 Aachen, Germany
> fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
> eMail: daniel.frey_at_a..., web: http://www.aixigo.de

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk