Boost logo

Boost :

From: Scott Woods (scottw_at_[hidden])
Date: 2003-10-05 17:05:27


Does the following make your compiler happy (does for VC6)

> Compiling the following code...
>
> template <typename T>
> class outer
> {
> public:
> template <typename U> class inner { };
> template <typename U> friend class inner;
> private:
> // ...
> };
>

change friend declaration to...

 friend class inner<typename>;

> int main()
> {
> typedef outer<int>::inner<double> test;
> }
>
> ...I get the following error with Comeau:
>
> error: template nesting depth does not match the previous
> declaration of class template "outer<T>::inner [with T=int]"
> template <typename U> friend class inner;
>
> In case it's not evident, the goal is for outer<T>::inner<U> to have
access
> to private members of outer<T>.
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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