This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
friend template class
- From: "He HongFu" <hhfesle1982 at 163 dot com>
- To: "gcc-help-list" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 11 Jun 2004 09:13:58 +0800
- Subject: friend template class
Hi:
I want to declare a templated class as a friend class but failed. the gcc verion is "gcc (GCC) 3.3.1 (cygming special)". Thanks in advance.
template<class T>
struct release {
friend class template<int i, class T> Tempx;
void operator () (T t) {
delete t;
}
private:
void foo () {
}
};
template <int i, typename T>
class Tempx {
void foo () {
release <int> r;
r.foo ();
}
};
He HongFu
hhfesle1982@163.com
2004-06-11