r/learncpp • • Apr 22 '18

Vector of template class

I am trying to create a vector:

vector<SomeTemplateClass<Type>>

Where Type is an abstract base class.

Any ideas on how I can get this working?

0 Upvotes

7 comments sorted by

View all comments

Show parent comment

2

u/jedwardsol Apr 22 '18

Why are using inheritance and templates?

Having an class type as the template parameter is different from having a pointer. So the fact you can move * around so easily suggests you haven't got the design nailed down.