I have a templated class defined (in part) as
template MyClass
{
public:
void DoSomething(){}
};
If I want to call DoSom
Ok, so the functor solution doesn't work as you need. Perhaps you should have your template class inherit from a common base "Interface" class. And then you use a vector of those.
Something like this:
class Base {
public:
virtual ~Base(){}
virtual void DoSomething() = 0;
}
template class MyClass : public Base {
public:
void DoSomething(){}
};
std::vector objects;
objects.push_back(new MyClass);
objects.push_back(new MyClass);