template <class T>
class A{
//...
};
class B{
//...
};
class C{
protected:
vector< A<B> > vec;
public:
void f(B *ptr);
};
C::f(B *ptr){
vec.push_back(ptr); // gives error
}
The line that I’m trying add element into the vector gives compiler error. How can i fix this one?
It expects an A, you give it a B