C
Christof Warlich
Hi,
I need to make a templated class A a friend of class B.
My problem: I think I know how to do this for both
1) _one_ specific template instantiation of class A, e.g.:
template<typename Type, unsigned int x> class A {
public:
void useSomeFunctionalityOfB(void);
};
class B {
friend class A<float, 7>;
};
2) _any_ instantiation of class A, e.g.:
template<typename Type, unsigned int x> class A {
public:
void useSomeFunctionalityOfB(void);
};
class B {
template<typename Type, unsigned int x> friend class A;
};
But I do _not_ know how to mix the two extremes, e.g.
how to make class A a friend of class B only for Type float,
but for any unsigned int x.
Is it possible to express this at all, and if so, how?
Thanks for any help,
Christof
I need to make a templated class A a friend of class B.
My problem: I think I know how to do this for both
1) _one_ specific template instantiation of class A, e.g.:
template<typename Type, unsigned int x> class A {
public:
void useSomeFunctionalityOfB(void);
};
class B {
friend class A<float, 7>;
};
2) _any_ instantiation of class A, e.g.:
template<typename Type, unsigned int x> class A {
public:
void useSomeFunctionalityOfB(void);
};
class B {
template<typename Type, unsigned int x> friend class A;
};
But I do _not_ know how to mix the two extremes, e.g.
how to make class A a friend of class B only for Type float,
but for any unsigned int x.
Is it possible to express this at all, and if so, how?
Thanks for any help,
Christof