This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: I can't get my friends to work


David Alan Gilbert writes:

> ll keeps its list of ll_elements and I want all the functions in 'll'
> to be friendly with ll_element so that ll methods  can get to the next
> pointer in ll_element.

Make sure you declar all templates before referring to them:

template <typename content> class ll;
template <tyepname content> class ll_iter;
template <typename content> class ll_element;

And then you declare

> template<class content> ll_element {
                         ^^ class keyword missing
>   friend ll<content>;
>   friend ll_iter<content>;  
          ^^ I'd advise you to add class keywords here to, but I'm not
sure these are required.
> }

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]