У меня есть пример кода:
#include
template<class T>
class Class
{
public:
typedef boost::shared_ptr<Class<T> > Ref;
};
template<class T>
class Class2
{
public:
Class<T>::Ref getAReference() {return Class<T>::Ref(new Class<T>);};
};
int main(){}
Когда я пытаюсь его скомпилировать, я получаю:
test.cpp:14: error: type ‘Class<T>’ is not derived from type ‘Class2<T>’
test.cpp:14: error: expected ‘;’ before ‘getAReference’
Не понимаю, почему не работает? Как мне заставить это работать?