Because the real situation is more like
Because I don't want clients to have to use new. So instead, I figured I could solve this with a template function. But I'm getting errors still. I make the member functiona add a template
std::vector<Thingy *> v;
void add(Thingy & t)
template <typename T> void add(const T & t);
But like, problems:
template <typename T> void Screen::add(const T& t)
1) I get a linker error saying that I have undefined references to the add function. Do I put the definition of the function in the header since templates are like 'supermacros' that need wierd instantiating or something?
2) Do I just hope that the user isn't stupid and passes something that is derived from Thingy? It'll definitely do wierd things if it isn't.