friend declaration for template class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john smith

    friend declaration for template class

    Hi, I have a class like so...

    template<class XV, class T> class Foo {
    Bar<T>* b;
    };

    and another class
    template<class T> class Bar {
    public:
    friend template<class XV, class T> class Foo<XV,T>; // wrong
    friend class Foo;
    // wrong
    friend class Foo<XV,T> //
    wrong
    };

    so what is the correct way to give Foo access to Bar's members? Thanks..

    Smith


Working...