template <class T>
class A {
private:
class B {
public:
int foo;
void bar();
};
B barbar();
};
template <class T>
A<T>::B A<T>::barbar() {
B b;
return b;
}
int main() {
}
I get the compile error:
rac3:~/420/420project_part1: g++ test.c
test.c:17: error: expected constructor, destructor, or type conversion before 'A'
Does anyone have any idea why? As far as I know, this is the proper syntax for declaring a method for a template class.
Thanks,
Calvin
C++ Nested Class (Solved)
Given the following code:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement