Let us consider the following nested templates case:
template<typename T>
class Outer{
public:
template<typename U>
class Inner{
public:
void f();
};
};
Then the following specialization
template<> template<typename U> void Outer<int>::Inner<U>::f(){};
results in compile-time error (I've tried to compile it with gcc 3.2.2)
main.cpp:XXX: invalid use of undefined type `class Outer<int>::Inner<U>'
main.cpp:XXX: declaration of `class Outer<int>::Inner<U>'
main.cpp:XXX: template definition of non-template `void
Outer<int>::Inner<U>::f()'
Can anyone help me to figure out the problem?
Thanks in advnace,
Andriy Shnyr
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:st*****@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]