A
Andriy Shnyr
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
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