c++ template: 'is not derived from type'
- by Allan
I do not understand why this code is not valid:
#include <vector>
template <typename T>
class A{
public:
A() { v.clear(); }
std::vector<A<T> *>::const_iterator begin(){
return v.begin();
}
private:
std::vector<A<T> *> v;
};
When compiling it with gcc, it get the following error:
…