Returning pointer to a nested class
I'm trying to compile this simple code in g++ 4.0.1:
Code:
#include <cstdlib>
template <class Data> class MyClass
{
public:
private:
class Inside {};
Inside* __func(int x);
};
template <class Data> Inside* MyClass<Data>::__func(int x) // This is line 14
{ return NULL; }
And I get :
test1.cpp:14: error: expected constructor, destructor, or type conversion before ‘*’ token
I've tried to fix it to no avail, could anyone please explain to me what am I doing wrong ? :confused:
Many thanks in advance,
stingerkiss