I've got template class and I wanted to have vector of this class type. I saw solution where you need to wrap the class with another class without template, and then have a vector of this new class. Now I want to downcast for example one of the list objects - but the cast not allowed. What should I do?
Example:
class Wrapper
{
}
template <typename T>
class Father : public Wrapper
{
}
int main()
{
std::vector<std::shared_ptr<Wrapper>> objects;
Father<int> object = (Father<int>)objects.at(0); // ERROR (lets say i know its integer)
}