Why not
template<typename T>
void my_func(std::vector<T>& vec);
?The reference (or use a pointer, if you want) ensures that derived types can be passed, and the template allows for any parameterization to be used.
The two resulting derived classes are not the same, and you cannot have a function that accepts the base template with a wild card type and pass both types into it.
In Java, you can do: void myFunc(List<?> list); and all List objects with any type can be accepted by this method, in addition any class that extended List can also be accepted into this method, such as ArrayList<?> or whatever.
As far as I've seen, this is impossible in C++, unfortunately.